How do I fix "Failed to refresh credentials" error in Shorebird CI builds?

Last updated: July 27, 2026

Context

When running Shorebird builds in CI/CD workflows, you may encounter a "Failed to refresh credentials" error that causes your builds to fail. This error typically appears with a message suggesting to log out and log in again, and occurs when your CI authentication token has expired or become invalid.

Answer

To resolve this issue, you need to generate a new CI authentication token. Follow these steps:

  1. On your local machine, run the following command to generate a new CI token:

    shorebird login:ci
  2. Copy the new token that is generated (note that it may appear similar to your old token, but it will be different)

  3. Update your CI/CD workflow configuration with the new token

  4. Re-run your build

Even if the new token appears similar to your previous one (same first and last characters), it is actually a different token that should resolve the authentication issue.

This solution is based on the resolution documented in the Shorebird GitHub issue tracker for similar authentication problems in CI environments.