openai/codex · error · OAuthStoreLockFailure

timed out after waiting for MCP OAuth aggregate-store lock

Error message

timed out after {acquire_timeout:?} waiting for MCP OAuth {store} aggregate-store lock {}

What it means

Raised when another codex process held the MCP OAuth aggregate-store lock past acquire_timeout while this process waited; it gives up to avoid an unbounded wait rather than risk interleaved read-modify-write of the credential store.

Solutions

  1. Retry the store operation after the other process finishes
  2. Find and terminate a hung codex process holding the lock
  3. Remove the stale lock file if no other process is running
  4. Increase the acquire timeout under heavy multi-process usage
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at codex-rs/rmcp-client/src/oauth/store_lock.rs:188 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/49c9c1f1bcb31c48. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rmcp-client/src/oauth/store_lock.rs:188

        store: OAuthStore,
        #[source]
        source: io::Error,
    },
    #[error("failed to create MCP OAuth {store} aggregate-store lock directory {}", path.display())]
    CreateDir {
        store: OAuthStore,
        path: PathBuf,
        #[source]
        source: io::Error,
    },
    #[error("failed to open MCP OAuth {store} aggregate-store lock {}", path.display())]
    Open {
        store: OAuthStore,
        path: PathBuf,
        #[source]
        source: io::Error,
    },
    #[error(
        "timed out after {acquire_timeout:?} waiting for MCP OAuth {store} aggregate-store lock {}",
        path.display()
    )]
    Timeout {
        store: OAuthStore,
        path: PathBuf,
        acquire_timeout: Duration,
    },
    #[error("failed to lock MCP OAuth {store} aggregate-store lock {}", path.display())]
    Lock {
        store: OAuthStore,
        path: PathBuf,
        #[source]
        source: io::Error,
    },
}

fn oauth_store_lock_path(codex_home: &Path, store: OAuthStore) -> PathBuf {

View on GitHub (pinned to 339751715c)