{"record":{"id":"1a090c1134519a3a","repo":"aaif-goose/goose","slug":"download-failed-response-status-response-sta","errorCode":null,"errorMessage":"Download failed: ${response.status} ${response.statusText}","messagePattern":"Download failed: (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/desktop/src/utils/githubUpdater.ts","lineNumber":181,"sourceCode":"    latestVersion: string,\n    onProgress?: (percent: number) => void\n  ): Promise<{ success: boolean; downloadPath?: string; extractedPath?: string; error?: string }> {\n    const downloadStartTime = Date.now();\n    try {\n      log.info('=== GitHubUpdater: STARTING DOWNLOAD ===');\n      log.info(`GitHubUpdater: Download URL: ${downloadUrl}`);\n      log.info(`GitHubUpdater: Version: ${latestVersion}`);\n      log.info(`GitHubUpdater: Timestamp: ${new Date().toISOString()}`);\n\n      log.info('GitHubUpdater: Initiating download fetch request...');\n      const response = await fetch(downloadUrl);\n      const fetchDuration = Date.now() - downloadStartTime;\n      log.info(\n        `GitHubUpdater: Download response received in ${fetchDuration}ms - Status: ${response.status} ${response.statusText}`\n      );\n\n      if (!response.ok) {\n        throw new Error(`Download failed: ${response.status} ${response.statusText}`);\n      }\n\n      // Get total size from headers\n      const contentLength = response.headers.get('content-length');\n      const totalSize = contentLength ? parseInt(contentLength, 10) : 0;\n      log.info(\n        `GitHubUpdater: Content-Length: ${totalSize} bytes (${(totalSize / 1024 / 1024).toFixed(2)} MB)`\n      );\n\n      if (!response.body) {\n        throw new Error('Response body is null');\n      }\n      let lastReportedPercent = -1; // Track last reported percentage to throttle updates\n      let lastLoggedPercent = -1; // Track for logging at 10% intervals\n\n      // Read the response stream\n      log.info('GitHubUpdater: Starting to read response stream...');\n      const reader = response.body.getReader();","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/ui/desktop/src/utils/githubUpdater.ts#L163-L199","documentation":"The actual binary fetch of the update asset (browser_download_url from the release) returned a non-OK status. Distinct from the API-call error: here the release metadata was fine but the download endpoint failed — commonly 404 (asset deleted/re-upload raced), 403 (rate limit or expired signed redirect), or network-layer 5xx on the CDN.","triggerScenarios":"downloadUpdate() in the GitHub fallback path; asset was replaced right after the metadata check so the old URL 404s; unauthenticated rate limit hit during download; proxies blocking objects.githubusercontent.com.","commonSituations":"Flaky connections mid-release-publish; corporate proxies/firewalls blocking the GitHub CDN domain; retried downloads after long pauses where the signed URL expired.","solutions":["Re-run checkForUpdates to refresh browser_download_url, then download immediately","If 403/429, respect the rate limit (see the API error) — wait or authenticate","Allow objects.githubusercontent.com through proxies/firewalls","Retry with backoff for transient 5xx; the updater does not retry on its own"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for (let i = 0; i < 3; i++) {\n  const response = await fetch(downloadUrl);\n  if (response.ok) break;\n  if (response.status === 403 || response.status === 429) throw new Error('rate limited');\n  await new Promise(r => setTimeout(r, 2 ** i * 500));\n  if (i === 2) throw new Error(`Download failed: ${response.status}`);\n}","preventionTips":["Re-check-for-updates right before downloading so browser_download_url is fresh","Retry transient 5xx with backoff; treat 404 as stale metadata, not transient","Verify CDN domains are reachable from managed networks"],"tags":["download","http","github-cdn","auto-update","network"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}