kolide / launcher

Osquery launcher, autoupdater, and packager
https://kolide.com/launcher
Other
503 stars 98 forks source link

[TUF] Retry executable checks and directory renames on update download #1556

Closed RebeccaMahany closed 7 months ago

RebeccaMahany commented 7 months ago

This is another attempt to address some of the most frequent errors in the logs that I see with the new autoupdater; they are both almost entirely Windows issues.

First:

could not download updates: [
  could not download update for launcher:
    could not add release launcher-x.y.z.tar.gz for binary launcher to library:
      could not move verified update:
        could not move staged target launcher-x.y.z.tar.gz from <root-dir>\updates\launcher\x.y.z-timestamp to <root-dir>\updates\launcher\x.y.z:
          rename <root_dir>\updates\launcher\x.y.z-timestamp C:\Program Files\Kolide\Launcher-kolide-k2\data\updates\launcher\x.y.z:
            Access is denied.
]

Second:

could not download updates: [
  could not download update for launcher:
    could not add release launcher-x.y.z.tar.gz for binary launcher to library:
      could not move verified update:
        could not verify executable:
          timeout when checking executable:
            context deadline exceeded
]

Per some previous investigation, these appear to both be timing issues, so I'm throwing some more retries in. This is a safe time to retry -- it just delays when launcher will load the new binary, but won't delay launcher startup. And it's better than having to wait another autoupdate interval to retry the download again.