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

Error updating application #161

Open
dguettler opened this issue Apr 19, 2018 · 3 comments
Open

Error updating application #161

dguettler opened this issue Apr 19, 2018 · 3 comments

Comments

@dguettler
Copy link

I'm running into the following error and am wondering if anybody has some hints how to debug this

[info] Checking for updates...
[error] There was a problem updating the application
[error] Error: Update check failed. The server sent an invalid response. Try again later.

From the Nuts logs I only see

download Oversight-osx-x64-0.0.12.zip for version 0.0.12 on channel stable for osx_64
downloaded Oversight-osx-x64-0.0.12.zip for version 0.0.12 on channel stable for osx_64

Testing the download URL via curl gets the correct zip file.

On the electron side I have

  const server = 'https://[REDACTED]'
  const feed = `${server}/download/${process.platform}`

  autoUpdater.setFeedURL(feed);

  setInterval(() => {
    log.info("Checking for updates...");
    autoUpdater.checkForUpdates();
  }, 60000);

  autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
    log.info("Update received: ", event, releaseNotes, releaseName);
    const dialogOpts = {
      type: 'info',
      buttons: ['Restart', 'Later'],
      title: 'Application Update',
      message: process.platform === 'win32' ? releaseNotes : releaseName,
      detail: 'A new version has been downloaded. Restart the application to apply the updates.'
    }

    dialog.showMessageBox(dialogOpts, (response) => {
      if (response === 0) autoUpdater.quitAndInstall()
    })
  })

  autoUpdater.on('error', (message) => {
    log.error('There was a problem updating the application')
    log.error(message)
  })

Any advice on next steps would be appreciated.

@dguettler
Copy link
Author

Ok, my mistake.
Everything started to work after changing the feedURL from download to update and include the version.

  const server = 'https://[REDACTED]'
  const version = app.getVersion();
  const feed = `${server}/update/${process.platform}/${version}`

The logs still indicate an error once the latest version has restarted. Seems like Squirrel.Mac doesn't like it if there is no update available.

[2018-04-19 17:03:44.073] [info] ===== Starting Oversight =====
[2018-04-19 17:03:44.073] [info] Version:  v7.9.0
[2018-04-19 17:04:43.918] [info] Checking for updates...
[2018-04-19 17:05:43.035] [info] Update received:  { preventDefault: [Function: preventDefault],
  sender: 
   AutoUpdater {
     _events: { 'update-downloaded': [Function], error: [Function] },
     _eventsCount: 2 } }  0.0.12
[2018-04-19 17:05:43.924] [info] Checking for updates...
[2018-04-19 17:06:08.197] [info] ===== Closing Oversight =====
[2018-04-19 17:06:24.629] [info] ===== Starting Oversight =====
[2018-04-19 17:06:24.633] [info] Version:  v7.9.0
[2018-04-19 17:07:24.448] [info] Checking for updates...
[2018-04-19 17:08:11.239] [error] There was a problem updating the application
[2018-04-19 17:08:11.240] [error] Error: Update check failed. The server sent an invalid response. Try again later.

@fott1
Copy link

fott1 commented Jul 2, 2018

@dguettler Hey, did you used it over https without any issue?

@dguettler
Copy link
Author

@fott1 indirectly yes.
I have Nuts running in OpenShift, so the SSL termination happens at the edge and the request Nuts receives is http only.

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

No branches or pull requests

2 participants