Problem
Users are intermittently experiencing authentication failures when using external identity providers (Google, GitHub, etc.) with the error:
ConnectError [failed_precondition] Intent has not succeeded (IDP-nme4gszsvx)
Root Cause Analysis
Primary Cause: Zitadel Multi-Replica Race Condition
The error originates from Zitadel's backend (internal/api/grpc/user/v2/intent.go) when retrieveIdentityProviderIntent is called before the intent has transitioned to the Succeeded state.
Known Issue: zitadel/zitadel#10932
When running multiple Zitadel replicas:
- User completes IDP authentication → callback processed by Replica A
- Intent transitions to
Succeeded state in event store
auth-ui calls RetrieveIdentityProviderIntent which hits Replica B
- Replica B hasn't synced the event yet
- Intent appears as
Started → Error thrown
Fixed in: Zitadel v4.6.2 (PR #11014)
Secondary Cause: Missing Error Handling in auth-ui
In apps/login/src/app/(main)/(boxed)/idp/[provider]/success/page.tsx at line 149:
const intent = await retrieveIDPIntent({
serviceUrl,
id,
token,
});
This call has no try-catch block. When Zitadel returns the failed_precondition error, it propagates as an unhandled exception.
Proposed Solution
Short-term Fix (auth-ui)
- Add error handling around
retrieveIDPIntent() call
- Implement retry logic with exponential backoff for the race condition
- Provide user-friendly error message with retry option
let intent;
try {
intent = await retrieveIDPIntentWithRetry({
serviceUrl,
id,
token,
});
} catch (error) {
Sentry.captureException(error, {
tags: { flow: 'idp_intent_retrieval', provider },
extra: { intentId: id },
});
if (error?.message?.includes('IDP-nme4gszsvx')) {
return loginFailed("Authentication is still processing. Please try again.");
}
return loginFailed("Authentication failed. Please try again.");
}
Long-term Fix
Upgrade Zitadel from v3.3.2 to v4.6.2+ which contains the race condition fix.
Affected Files
| File |
Lines |
Issue |
apps/login/src/app/(main)/(boxed)/idp/[provider]/success/page.tsx |
149-153 |
Missing error handling |
apps/login/src/lib/zitadel.ts |
1329-1347 |
retrieveIDPIntent() - no retry logic |
Related Issues
Labels
Problem
Users are intermittently experiencing authentication failures when using external identity providers (Google, GitHub, etc.) with the error:
Root Cause Analysis
Primary Cause: Zitadel Multi-Replica Race Condition
The error originates from Zitadel's backend (
internal/api/grpc/user/v2/intent.go) whenretrieveIdentityProviderIntentis called before the intent has transitioned to theSucceededstate.Known Issue: zitadel/zitadel#10932
When running multiple Zitadel replicas:
Succeededstate in event storeauth-uicallsRetrieveIdentityProviderIntentwhich hits Replica BStarted→ Error thrownFixed in: Zitadel v4.6.2 (PR #11014)
Secondary Cause: Missing Error Handling in auth-ui
In
apps/login/src/app/(main)/(boxed)/idp/[provider]/success/page.tsxat line 149:This call has no try-catch block. When Zitadel returns the
failed_preconditionerror, it propagates as an unhandled exception.Proposed Solution
Short-term Fix (auth-ui)
retrieveIDPIntent()callLong-term Fix
Upgrade Zitadel from v3.3.2 to v4.6.2+ which contains the race condition fix.
Affected Files
apps/login/src/app/(main)/(boxed)/idp/[provider]/success/page.tsxapps/login/src/lib/zitadel.tsretrieveIDPIntent()- no retry logicRelated Issues
Labels