{"record":{"id":"0b428129e66c3f13","repo":"spicetify/cli","slug":"unexpected-http-status-s-for-s","errorCode":null,"errorMessage":"unexpected HTTP status: %s for %s","messagePattern":"unexpected HTTP status: (.+?) for (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/update.go","lineNumber":69,"sourceCode":"\tout, err := os.Create(location)\n\tif err != nil {\n\t\tspinner.Fail(\"Failed to download Spicetify\")\n\t\tutils.Fatal(err)\n\t}\n\tdefer out.Close()\n\n\tresp2, err := http.Get(assetURL)\n\tif err != nil {\n\t\tout.Close()\n\t\tspinner.Fail(\"Failed to download Spicetify\")\n\t\tutils.Fatal(err)\n\t}\n\n\tif resp2.StatusCode != http.StatusOK {\n\t\tresp2.Body.Close()\n\t\tout.Close()\n\t\tspinner.Fail(\"Failed to download Spicetify\")\n\t\tutils.Fatal(fmt.Errorf(\"unexpected HTTP status: %s for %s\", resp2.Status, assetURL))\n\t}\n\n\tdefer resp2.Body.Close()\n\n\t_, err = io.Copy(out, resp2.Body)\n\tif err != nil {\n\t\tresp2.Body.Close()\n\t\tout.Close()\n\t\tspinner.Fail(\"Failed to download Spicetify\")\n\t\tutils.Fatal(err)\n\t}\n\tspinner.Success(\"Downloaded Spicetify\")\n\n\texe, err := os.Executable()\n\tif err != nil {\n\t\tutils.Fatal(err)\n\t}\n\tif exe, err = filepath.EvalSymlinks(exe); err != nil {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/spicetify/cli/blob/1f13f736163165234eef4fb792a03f9b5b732aa4/src/cmd/update.go#L51-L87","documentation":"During Update, spicetify downloads the latest release asset and expects HTTP 200. If the download response status is anything else it closes the body/file, fails the spinner, and calls utils.Fatal with this error naming the status and asset URL. It means the release asset could not be downloaded at that URL.","triggerScenarios":"Update() performs the asset download request (resp2) and resp2.StatusCode != http.StatusOK — e.g. 403 (rate limit/expired URL), 404 (asset renamed/removed), 302-followed-to-error, or 5xx from the CDN.","commonSituations":"GitHub rate limiting in CI; upstream release re-replaced and old asset URL 404s; corporate proxy blocking github release CDN (objects.githubusercontent.com); transient GitHub outage.","solutions":["Retry the update; CDN 5xx/429 issues are often transient.","Check the assetURL printed in the error manually in a browser to confirm it 404s or is blocked.","If rate limited, authenticate requests with a GITHUB_TOKEN or wait for the limit reset.","Update via an alternative channel (package manager, manual download of the release asset) if the proxy blocks GitHub.","Verify spicetify version supports the current upstream release layout (asset name changes cause 404s)."],"exampleFix":"// before\nif resp2.StatusCode != http.StatusOK {\n    utils.Fatal(fmt.Errorf(\"unexpected HTTP status: %s for %s\", resp2.Status, assetURL))\n}\n// after (caller-side retry)\nfor i := 0; i < 3; i++ {\n    if err := tryUpdate(); err == nil { break }\n    time.Sleep(5 * time.Second)\n}","handlingStrategy":"retry","validationCode":"// Preflight: HEAD the asset URL\nresp, err := http.Head(assetURL)\nif err == nil && resp.StatusCode != http.StatusOK {\n    return fmt.Errorf(\"asset unavailable: %s\", resp.Status)\n}","typeGuard":null,"tryCatchPattern":"err := runUpdate()\nif err != nil && strings.Contains(err.Error(), \"unexpected HTTP status\") {\n    time.Sleep(10 * time.Second)\n    err = runUpdate() // retry once for transient 5xx/429\n}","preventionTips":["Retry downloads with backoff; GitHub CDN hiccups are common.","Authenticate GitHub downloads in CI to avoid 403/429 rate limits.","Check the release asset name/URL scheme still matches your updater version."],"tags":["network","http","update","download"],"backgroundTag":"unexpected-http-status","analyzedSha":"1f13f736163165234eef4fb792a03f9b5b732aa4","analyzedAt":"2026-08-31T18:57:59.754Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}