Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.

Open 💬 5 comments Opened Apr 10, 2026 by nightsparc
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.118.0

What subscription do you have?

Business

Which model were you using?

gpt-5.4-high

What platform is your computer?

Linux 6.11.0-17-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

Terminator

What issue are you seeing?

Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.

Duplicate of https://github.com/openai/codex/issues/9634 ?

What steps can reproduce the bug?

Uploaded thread: 019d2997-375f-7423-ab68-dc235ba73780

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #15754

Powered by Codex Action

nightsparc · 4 months ago

It is a duplicate; however, the statement https://github.com/openai/codex/issues/9634#issuecomment-4150528481 said that it should be fixed w/ 0.117, I observed this w/ 0.118.0

Or should https://github.com/openai/codex/issues/9634 be re-opened?

Was able to fix it as described here: https://github.com/openai/codex/issues/9634#issuecomment-4130336515

Kushalkhemka · 4 months ago

Issue https://github.com/openai/codex/issues/19531 Same issue is faced again recently tried all above method still same

nick-youngblut · 3 months ago

Reproduces on codex-cli 0.128.0 (Linux x86_64, Ubuntu 24.04, bash) — so still present 10 releases past 0.118.0.

Setup that triggers it for me — single OpenAI account, three machines:

  • MacBook (most recently logged in): works fine, no error.
  • HPC login node A (this one): throws the refresh-token error.
  • HPC login node B: same error.

Each host has its own ~/.codex/auth.json, so this is not the multi-account / concurrent-instances-on-one-host case @etraut-openai diagnosed in #9634 — it's the same account across multiple hosts, where logging in on host C appears to invalidate the refresh tokens stored on hosts A and B. Matches #19531's CLI + app symptom. The PR #11802 fix doesn't seem to cover this path.

Other bits from this host that may help narrow it down:

  • pgrep -af codex on the failing host returned no other codex processes when the error fired — not "older instance still running" on a single host.
  • ~/.codex/auth.json mtime hadn't moved since the last successful login on this host (~25h prior); the failed refresh isn't writing anything new locally.
  • Same invocation also prints WARNING: failed to clean up stale arg0 temp dirs: Directory not empty (os error 39). ~/.codex/tmp/arg0/ has 9 leftover codex-arg0* dirs from prior runs (most empty; only the live PID's dir holds .lock + the apply_patch / codex-execve-wrapper / codex-linux-sandbox symlinks). Probably orthogonal to auth, but fires on every startup and may indicate a related cleanup path.

Workaround from #9634 (rm -f ~/.codex/auth.json + re-login on the affected host) works, but on a multi-host setup it just shifts the broken host to whichever one was previously good.

nos1609 · 3 months ago

Same behaviour on codex-cli 0.130.0