matryer/xbar · error

failed to check for updates: got %s

Error message

failed to check for updates: got %s

What it means

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.

Source

Thrown at pkg/update/update.go:121

		}
		return errors.Wrap(err, "starting new app failed")
	}
	log.Println("waiting before terminating after update...")
	time.Sleep(1 * time.Second)
	log.Println("terminating after update.")
	os.Exit(0)
	return nil
}

// getLatestRelease gets the latest release.
func (u *Updater) getLatestRelease() (*Release, error) {
	resp, err := u.Client.Get(u.LatestReleaseGitHubEndpoint)
	if err != nil {
		return nil, errors.Wrap(err, "get latest release")
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return nil, errors.Errorf("failed to check for updates: got %s", resp.Status)
	}
	b, err := io.ReadAll(io.LimitReader(resp.Body, u.DownloadBytesLimit))
	if err != nil {
		return nil, errors.Wrap(err, "read body")
	}
	var latestRelease Release
	err = json.Unmarshal(b, &latestRelease)
	if err != nil {
		return nil, errors.Wrap(err, "marshal")
	}
	latestRelease.CreatedAt, err = time.Parse(time.RFC3339Nano, latestRelease.CreatedAtString)
	if err != nil {
		return nil, errors.Wrap(err, "time.Parse: created_at")
	}
	return &latestRelease, nil
}

// HasUpdate checks whether there's an update or not.

View on GitHub (pinned to d624239058)

Solutions

  1. Read the wrapped status string to identify the server response (403 often means GitHub API rate limiting)
  2. Retry later if the status is 5xx or a rate-limit response, ideally honoring the Retry-After header
  3. Check for an API token or unauthenticated rate-limit exhaustion on the client
  4. Verify the repository and LatestReleaseGitHubEndpoint still exist (404) and update the endpoint if the repo moved
  5. Handle the failure gracefully so the app keeps working with the currently installed version
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/update/update.go:121 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of matryer/xbar@d624239058 (2026-09-02). Data as JSON: /api/errors/11d07ad1b8959626. Report an issue: GitHub.