{"record":{"id":"b016201a827be138","repo":"aaif-goose/goose","slug":"update-file-not-found-please-download-the-update","errorCode":null,"errorMessage":"Update file not found. Please download the update first.","messagePattern":"Update file not found\\. Please download the update first\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/desktop/src/utils/autoUpdater.ts","lineNumber":290,"sourceCode":"\n  ipcMain.handle('install-update', async () => {\n    if (isUsingGitHubFallback) {\n      // For GitHub fallback, we need to handle the installation differently\n      log.info('Installing update from GitHub fallback...');\n\n      try {\n        // Use the stored extracted path if available, otherwise download path\n        const updatePath = githubUpdateInfo.extractedPath || githubUpdateInfo.downloadPath;\n\n        if (!updatePath) {\n          throw new Error('Update file path not found. Please download the update first.');\n        }\n\n        // Check if the update path exists\n        try {\n          await fs.access(updatePath);\n        } catch {\n          throw new Error('Update file not found. Please download the update first.');\n        }\n\n        // Improved dialog with clearer instructions\n        const dialogResult = (await dialog.showMessageBox({\n          type: 'info',\n          title: 'Update Ready to Install',\n          message: `Version ${githubUpdateInfo.latestVersion} is ready to install.`,\n          detail: `The update has been downloaded and extracted. To complete the installation:\\n\\n1. Click \"Open Folder\" to view the new Goose.app\\n2. Quit Goose (this app will close)\\n3. Drag the new Goose.app to your Applications folder\\n4. Replace the existing app when prompted\\n\\nThe update will be available the next time you launch Goose.`,\n          buttons: ['Open Folder & Quit', 'Open Folder Only', 'Cancel'],\n          defaultId: 0,\n          cancelId: 2,\n        })) as unknown as { response: number };\n\n        if (dialogResult.response === 0) {\n          trackUpdateInstallInitiated(\n            githubUpdateInfo.latestVersion || 'unknown',\n            'github-fallback',\n            'open_folder_and_quit'","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/ui/desktop/src/utils/autoUpdater.ts#L272-L308","documentation":"Companion guard to the missing-path check: the GitHub fallback stored an update path (extractedPath or downloadPath) but fs.access fails, so the file/directory no longer exists on disk. Thrown before the installer dialog is shown, telling the user the downloaded artifact vanished — typically cleaned by temp-dir policies or deleted manually.","triggerScenarios":"OS temp cleanup removed the downloaded update between download and install; user or a cleaning tool deleted the file; app restarted mid-flow so the path pointed into a purged temp dir; disk full or permissions changed.","commonSituations":"Downloads left in /tmp or cache dirs that are vacuumed on schedule; long gaps between 'Update available' and clicking Install; enterprise disk-cleanup agents.","solutions":["Re-download the update (download-update) to regenerate the artifact, then install immediately","Check whether the extracted/download directory still exists and isn't on a tmpfs that clears on reboot","Free disk space if extraction failed silently","Install soon after downloading rather than much later"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before invoking install, verify artifact still exists:\nimport { access } from 'fs/promises';\n// (main process) expose hasUpdateArtifact() IPC:\nawait access(githubUpdateInfo.extractedPath || githubUpdateInfo.downloadPath!);","typeGuard":"const updateArtifactExists = async (): Promise<boolean> => {\n  const p = githubUpdateInfo.extractedPath || githubUpdateInfo.downloadPath;\n  if (!p) return false;\n  try { await fs.access(p); return true; } catch { return false; }\n};","tryCatchPattern":"try {\n  await window.api.installUpdate();\n} catch (e) {\n  if (String(e).includes('Update file not found')) {\n    await window.api.downloadUpdate(); // regenerate, then install\n    await window.api.installUpdate();\n  }\n}","preventionTips":["Download updates to a stable app-cache dir, not OS temp that clears on reboot","Install immediately after download completes","Re-validate artifact existence on app focus if install was deferred"],"tags":["auto-update","filesystem","github-fallback","temp-files"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}