{"record":{"id":"11d07ad1b8959626","repo":"matryer/xbar","slug":"failed-to-check-for-updates-got-s","errorCode":null,"errorMessage":"failed to check for updates: got %s","messagePattern":"failed to check for updates: got (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/update/update.go","lineNumber":121,"sourceCode":"\t\t}\n\t\treturn errors.Wrap(err, \"starting new app failed\")\n\t}\n\tlog.Println(\"waiting before terminating after update...\")\n\ttime.Sleep(1 * time.Second)\n\tlog.Println(\"terminating after update.\")\n\tos.Exit(0)\n\treturn nil\n}\n\n// getLatestRelease gets the latest release.\nfunc (u *Updater) getLatestRelease() (*Release, error) {\n\tresp, err := u.Client.Get(u.LatestReleaseGitHubEndpoint)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"get latest release\")\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, errors.Errorf(\"failed to check for updates: got %s\", resp.Status)\n\t}\n\tb, err := io.ReadAll(io.LimitReader(resp.Body, u.DownloadBytesLimit))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"read body\")\n\t}\n\tvar latestRelease Release\n\terr = json.Unmarshal(b, &latestRelease)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"marshal\")\n\t}\n\tlatestRelease.CreatedAt, err = time.Parse(time.RFC3339Nano, latestRelease.CreatedAtString)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"time.Parse: created_at\")\n\t}\n\treturn &latestRelease, nil\n}\n\n// HasUpdate checks whether there's an update or not.","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/update/update.go#L103-L139","documentation":"Raised in Updater.getLatestRelease when the GitHub releases endpoint answered, but with a non-200 status (e.g. 403 rate limiting, 404 repository moved, 5xx server error). The message embeds resp.Status, so it reports exactly what the server returned; the release payload is unusable and update checking aborts.","triggerScenarios":"Thrown at pkg/update/update.go:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped status string to identify the server response (403 often means GitHub API rate limiting)","Retry later if the status is 5xx or a rate-limit response, ideally honoring the Retry-After header","Check for an API token or unauthenticated rate-limit exhaustion on the client","Verify the repository and LatestReleaseGitHubEndpoint still exist (404) and update the endpoint if the repo moved","Handle the failure gracefully so the app keeps working with the currently installed version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}