Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub auto-update on Windows returning error #1112

Closed
JustinBeckwith opened this issue Jan 13, 2017 · 7 comments · May be fixed by qcif/data-curator#563
Closed

GitHub auto-update on Windows returning error #1112

JustinBeckwith opened this issue Jan 13, 2017 · 7 comments · May be fixed by qcif/data-curator#563

Comments

@JustinBeckwith
Copy link

  • Version: 10.12.0
  • Target: Windows

I'm having some trouble getting auto-updates for Windows to work. I've installed the electron-auto-updater npm module, and mostly got everything set up. My builds are producing app-latest.yml files. When I try running my installed app, I'm getting this error:

[2017-01-13 07:53:13:0250] [error] SyntaxError: Unexpected end of JSON input
SyntaxError: Unexpected end of JSON input
    at IncomingMessage.response.on.e (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\src\electronHttpExecutor.ts:132:55)
    at emitNone (events.js:86:13)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
    at ElectronHttpExecutor.doApiRequest (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\src\electronHttpExecutor.ts:89:5)
    at ElectronHttpExecutor.request (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-builder-http\src\httpExecutor.ts:52:17)
    at request (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-builder-http\src\httpExecutor.ts:147:38)
    at C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\src\GitHubProvider.ts:14:26
    at next (<anonymous>)
From previous event:
    at GitHubProvider.getLatestVersion (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\out\GitHubProvider.js:60:11)
    at C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\src\NsisUpdater.ts:110:38
From previous event:
    at NsisUpdater.doCheckForUpdates (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\out\NsisUpdater.js:196:11)
    at C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\src\NsisUpdater.ts:100:25
    at next (<anonymous>)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at NsisUpdater._checkForUpdates (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\out\NsisUpdater.js:162:11)
    at NsisUpdater.checkForUpdates (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\node_modules\electron-auto-updater\src\NsisUpdater.ts:84:35)
    at WebContents.window.webContents.once (C:\Users\beckwith\AppData\Local\Programs\app-engine-trebuchet\resources\app.asar\appUpdater.js:68:17)
    at WebContents.g (events.js:286:16)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)

Based on the callstack, I did a little digging and found this code. I decided to try hitting the same endpoint with Postman, set my accept header to application/json, and I'm getting an HTTP 406 from Github:
https://github.com/JustinBeckwith/trebuchet/releases/latest

It's possible I'm way off, but I can't quite figure out how this is supposed to work.

@develar
Copy link
Member

develar commented Jan 13, 2017

Please use latest electron-builder 11.2.5. Be aware about #1106 Do you use electron-auto-updater 0.10.1?

@develar develar closed this as completed Jan 13, 2017
@develar develar reopened this Jan 13, 2017
@develar
Copy link
Member

develar commented Jan 13, 2017

Yes, you are right, 406.

@develar
Copy link
Member

develar commented Jan 13, 2017

cc @badams

@develar
Copy link
Member

develar commented Jan 13, 2017

@JustinBeckwith All your releases marked as Pre-release, so, it is not release and Github doesn't return latest release info because no release.

@badams
Copy link
Contributor

badams commented Jan 13, 2017

Still works as expected, eg sending a request to https://github.com/develar/__test_nsis_release/releases/latest with header
Accept: application/json responds with

{"id":4567222,"tag_name":"v1.1.0","update_url":"/develar/__test_nsis_release/releases/tag/v1.1.0","update_authenticity_token":"nBK9/tyCGHNM39wpbsTX4wJNqwyoy2PGG8MHaJG1kfAXfQp3aAiv4Ek5b7juFpKcOzJeqDmKfqSbfUkftdXbAg==","delete_url":"/develar/__test_nsis_release/releases/tag/v1.1.0","delete_authenticity_token":"xauh1iYf9pQn2mqwFMkPMP6wSsmhFQ/eNJwGSwEvKfY1ErVI6MX9rnxAbdmWdjNngCmJWRHUj/sOSbTusD6UAg==","edit_url":"/develar/__test_nsis_release/releases/edit/v1.1.0"}

Probably should add some error handling for when no releases exist though

@develar
Copy link
Member

develar commented Jan 13, 2017

Probably should add some error handling for when no releases exist though

Yes. For this reason this issue is opened. Do you want to help to fix it?

@badams
Copy link
Contributor

badams commented Jan 13, 2017

@develar Yes I can take a look over the weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants