redis/jedis · critical · JedisAuthenticationException

AuthXManager failed to start!

Error message

AuthXManager failed to start!

What it means

AuthXManager coordinates periodic re-authentication using token managers (e.g. for IAM/OIDC-style identity tokens). start() submits the token manager start task and waits; if that task fails (InterruptedException or ExecutionException), it logs and rethrows as JedisAuthenticationException.

Solutions

  1. Inspect the logged cause (e.getCause()) for the token manager's root failure.
  2. Verify identity/token provider endpoint, credentials, and network reachability.
  3. Retry client construction after fixing credentials/endpoint.
  4. Check for premature thread interruption in your shutdown code.

Example fix

// before
AuthXManager m = new AuthXManager(badTokenManagerConfig);
m.start(); // JedisAuthenticationException
// after
// fix tokenManager config: correct endpoint + valid credentials, then
AuthXManager m = new AuthXManager(correctConfig);
m.start();
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check token manager reachability
try (Socket s = new Socket(tokenHost, tokenPort)) { /* reachable */ }

Try / catch

try {
  authXManager.start();
} catch (JedisAuthenticationException e) {
  Throwable root = e.getCause();
  log.error("Token manager startup failed", root);
}

Prevention

When it happens

Trigger: The underlying token manager fails to initialize/fetch its first token: unreachable identity/credentials provider, invalid credentials, network timeouts, or the start thread is interrupted.

Common situations: Wrong OIDC/IAM endpoint configured, expired or missing credentials, corporate proxy blocking the token endpoint, container DNS failures, JDK interruption during shutdown.

Related errors


AI-assisted analysis of redis/jedis@6dac31d4c2 (2026-09-08). Data as JSON: /api/errors/06224b40362ea813. Report an issue: GitHub.

Appendix: source

Thrown at src/main/java/redis/clients/jedis/authentication/AuthXManager.java:52

    private final List<Consumer<Token>> postAuthenticateHooks = new ArrayList<>();
    private final AtomicReference<CompletableFuture<Void>> uniqueStarterTask = new AtomicReference<>();

    protected AuthXManager(TokenManager tokenManager) {
        this.tokenManager = tokenManager;
    }

    public AuthXManager(TokenAuthConfig tokenAuthConfig) {
        this(new TokenManager(tokenAuthConfig.getIdentityProviderConfig().getProvider(),
                tokenAuthConfig.getTokenManagerConfig()));
    }

    public void start() {
        Future<Void> safeStarter = safeStart(this::tokenManagerStart);
        try {
            safeStarter.get();
        } catch (InterruptedException | ExecutionException e) {
            log.error("AuthXManager failed to start!", e);
            throw new JedisAuthenticationException("AuthXManager failed to start!",
                    (e instanceof ExecutionException) ? e.getCause() : e);
        }
    }

    private Future<Void> safeStart(Runnable starter) {
        if (uniqueStarterTask.compareAndSet(null, new CompletableFuture<Void>())) {
            try {
                starter.run();
                uniqueStarterTask.get().complete(null);
            } catch (Exception e) {
                uniqueStarterTask.get().completeExceptionally(e);
            }
        }
        return uniqueStarterTask.get();
    }

    private void tokenManagerStart() {
        tokenManager.start(new TokenListener() {

View on GitHub (pinned to 6dac31d4c2)