twentyhq/twenty · error · Error
App registration exists but could not be found: ${app.univer
Error message
App registration exists but could not be found: ${app.universalIdentifier} What it means
Thrown by ensureAppRegistration in a narrow edge case: the create mutation returned UNIVERSAL_IDENTIFIER_ALREADY_CLAIMED (meaning a registration with this universalIdentifier exists on the server), but the subsequent findApplicationRegistrationByUniversalIdentifier query failed or returned no data. The registration supposedly exists but cannot be retrieved.
Source
Thrown at packages/twenty-sdk/src/cli/utilities/auth/ensure-app-registration.ts:57
);
if (!isAlreadyClaimed) {
const errorDetail =
createResult.error instanceof Error
? createResult.error.message
: ((createResult.error as { message?: string })?.message ??
String(createResult.error));
throw new Error(`Failed to create app registration: ${errorDetail}`);
}
const findResult =
await apiService.findApplicationRegistrationByUniversalIdentifier(
app.universalIdentifier,
);
if (!findResult.success || !findResult.data) {
throw new Error(
`App registration exists but could not be found: ${app.universalIdentifier}`,
);
}
const registration = findResult.data;
await configService.setConfig({
appRegistrationId: registration.id,
appRegistrationClientId: registration.oAuthClientId,
appAccessToken: undefined,
appRefreshToken: undefined,
});
// The registration may be a catalog-synced npm app owned by another (or no)
// workspace, so rotating its shared client secret is neither allowed nor
// desirable. Dev mode mints workspace-scoped app tokens via the
// generateApplicationToken mutation instead.
return {View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Retry the command after a short delay — this is often a transient eventual-consistency issue.
- Verify the authenticated user/workspace has access to the registration with the given universalIdentifier.
- If the identifier belongs to a catalog-synced npm app owned by another workspace, ensure you are using the correct workspace credentials.
- Contact the Twenty platform team if the registration persistently cannot be found despite the 'already claimed' response.
Defensive patterns
Strategy: retry
Try / catch
const ensureWithRetry = async (
apiService: ApiService,
configService: ConfigService,
app: { name: string; universalIdentifier: string },
retries = 3,
): Promise<ReturnType<typeof ensureAppRegistration>> => {
for (let attempt = 0; attempt <= retries; attempt++) {
try {
return await ensureAppRegistration(apiService, configService, app);
} catch (error) {
if (error instanceof Error && error.message.includes('could not be found') && attempt < retries) {
await new Promise((r) => setTimeout(r, 1000 * (attempt + 1)));
continue;
}
throw error;
}
}
throw new Error('unreachable');
}; Prevention
- Retry the command after a short delay — this is often a transient consistency issue.
- Verify the workspace credentials have read access to the registration.
- If persistent, contact the platform team to investigate the registration record.
When it happens
Trigger: After the 'already claimed' sub-code, the code calls findApplicationRegistrationByUniversalIdentifier. If that call returns { success: false } or { data: null/falsy }, this error fires. This indicates a race condition, eventual-consistency lag, permission issue, or data inconsistency on the server.
Common situations: Another process or team member just claimed the identifier on a different workspace and replication lag means the find query hasn't caught up. The current authenticated session doesn't have read access to the workspace that owns the registration. The registration was deleted between the create attempt and the find query.
Related errors
- Failed to create app registration: ${errorDetail}
- Failed to introspect core schema: ${JSON.stringify(coreSchem
- createCompany did not return an id
- createPerson did not return an id
- createOpportunity did not return an id
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/9f6dea7e58ef45a1.
Report an issue: GitHub.