twentyhq/twenty · error · Error
Failed to rename CallRecording name collision for workspace
Error message
Failed to rename CallRecording name collision for workspace ${workspaceId}: ${JSON.stringify(renameResult, null, 2)} What it means
Thrown by the 2.10 CallRecording sync command when an individual rename migration (object or field collision rename) returns status 'fail'. Renames are committed one-per-migration before the create, because a combined create+rename trips the namePlural unique index. The full renameResult JSON is embedded in the message itself, not just logged.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000055000-sync-call-recording-standard-objects.command.ts:518
// Collisions can belong to different applications, so each rename runs as
// its own migration scoped to the colliding entity's application.
for (const {
applicationUniversalIdentifier,
allFlatEntityOperationByMetadataName,
} of collisionRenameMigrations) {
const renameResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
{
isSystemBuild: true,
applicationUniversalIdentifier,
workspaceId,
allFlatEntityOperationByMetadataName,
},
);
if (renameResult.status === 'fail') {
throw new Error(
`Failed to rename CallRecording name collision for workspace ${workspaceId}: ${JSON.stringify(
renameResult,
null,
2,
)}`,
);
}
}
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
{
isSystemBuild: true,
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
workspaceId,
allFlatEntityOperationByMetadataName,
},View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Parse the renameResult JSON embedded in the error message for the exact rejection.
- Recompute the workspace cache so the collision detection and rename targets are accurate, then re-run.
- Run --dryRun first; it logs planned object/field rename counts without committing.
- If a specific object/field blocks the rename, manually reconcile or delete it in the failing workspace.
Defensive patterns
Strategy: validation
Validate before calling
// Dry-run logs planned rename counts; confirm collision detection sees the same objects:
await workspaceCacheService.invalidate(workspaceId);
const { flatObjectMetadataMaps, flatFieldMetadataMaps } = await workspaceCacheService.getOrRecompute(workspaceId, ['flatObjectMetadataMaps', 'flatFieldMetadataMaps']);
const objectCollisions = findCallRecordingObjectNameCollisions(flatObjectMetadataMaps);
const fieldCollisions = findCalendarEventFieldNameCollisionsForCallRecording(flatFieldMetadataMaps);
if (objectCollisions.length + fieldCollisions.length === 0) {
logger.log('No collisions detected; rename step will be skipped');
} Try / catch
// Parse the embedded renameResult JSON from the message to decide retry vs escalate:
try {
await command.runOnWorkspace({ workspaceId, options });
} catch (err) {
const match = /Failed to rename CallRecording name collision[\s\S]*?(\{[\s\S]*\})/.exec(err.message);
const result = match ? JSON.parse(match[1]) : null;
logger.error(`CallRecording rename failed for workspace ${workspaceId}`, result ?? err);
failedWorkspaces.push(workspaceId);
} Prevention
- Run --dryRun first; it logs planned object/field rename counts without committing.
- Recompute the cache so collision detection and rename targets are accurate.
- If a specific object/field blocks the rename, reconcile or delete it before retrying.
- Parse the embedded renameResult JSON before retrying; never retry unchanged.
When it happens
Trigger: Running the 2.10 CallRecording sync on a workspace with a colliding callRecording/callRecordings object or calendarEvent field whose rename migration the builder rejects (e.g. target name still collides, or the object/field is referenced elsewhere blocking rename).
Common situations: Workspace has many manually-created callRecordingOld* names exhausting candidates used by the rename; stale cache so the collision set is wrong; the colliding entity is referenced by relations/views that block the rename.
Related errors
- Failed to rename conflicting custom fields for workspace ${w
- Could not find an available callRecordingOld name after ${MA
- Failed to create CallRecording standard objects for workspac
- Could not find an available ${originalFieldName}Old name aft
- Failed to create CallRecording recordingRequestStatus metada
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/fc9be0de4273934a.
Report an issue: GitHub.