nuts icon indicating copy to clipboard operation
nuts copied to clipboard

Error updating application

Open dguettler opened this issue 7 years ago • 3 comments

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 avatar Apr 19 '18 20:04 dguettler

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.

dguettler avatar Apr 19 '18 21:04 dguettler

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

fott1 avatar Jul 02 '18 07:07 fott1

@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.

dguettler avatar Jul 02 '18 10:07 dguettler