Skip to content
Latchkey

act_runner registration token expired in CI

Gitea registration tokens are time-limited. Registering an act_runner with a token that has already expired is rejected even when the instance URL is correct. Generate a fresh token and register immediately.

What this error means

act_runner register fails with an invalid or expired token error. The instance URL is reachable, but the token no longer authorizes registration.

act_runner
level=fatal msg="failed to register runner: received status code 400
(runner registration token has expired or is invalid)"

Common causes

The token expired before registration ran

Registration tokens have a short lifetime; a token copied and left unused past its window is no longer valid.

The token was rotated or revoked

Regenerating a token in the UI invalidates the previous one, so an old copy stops working.

How to fix it

Generate a fresh token and register right away

  1. Open the instance, org, or repo Runners settings and copy a new token.
  2. Run act_runner register with that token without delay.
  3. Confirm the runner appears Idle.
Terminal
act_runner register --no-interactive \
  --instance https://gitea.example.com \
  --token <FRESH_TOKEN> --name ci-runner-1

Automate token retrieval for provisioning

When provisioning runners programmatically, fetch a token from the API at register time so it is never stale.

Terminal
# fetch a fresh token, then register in the same script run
act_runner register --no-interactive --instance "$URL" --token "$TOKEN"

How to prevent it

  • Register runners immediately after generating a token.
  • Fetch tokens at provisioning time, not ahead of use.
  • Re-run registration if a token was rotated.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →