twentyhq/twenty · error · Error
Failed to sync CallRecording navigation command menu item av
Error message
Failed to sync CallRecording navigation command menu item availability expression for workspace ${workspaceId} What it means
Thrown by the 2.17 command that syncs the CallRecording navigation command menu item availability expression when validateBuildAndRunLegacyWorkspaceMigration returns status 'fail'. The logger.error above prints the full result; the thrown error is workspace-scoped. The payload updates commandMenuItem rows in the twentyStandard application.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-17/2-17-workspace-command-1801000000000-sync-call-recording-navigation-command-menu-item-availability-expression.command.ts:91
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
{
isSystemBuild: true,
workspaceId,
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
allFlatEntityOperationByMetadataName: {
commandMenuItem: commandMenuItemOperations,
},
},
);
if (validateAndBuildResult.status === 'fail') {
this.logger.error(
`Failed to sync CallRecording navigation command menu item availability expression:\n${JSON.stringify(validateAndBuildResult, null, 2)}`,
);
throw new Error(
`Failed to sync CallRecording navigation command menu item availability expression for workspace ${workspaceId}`,
);
}
this.logger.log(
`Successfully synced ${commandMenuItemsToUpdate.length} CallRecording navigation command menu item availability expression(s) for workspace ${workspaceId}`,
);
}
}
View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Inspect the logger.error output above the throw to find which commandMenuItem and which validation code failed.
- Confirm the targeted CallRecording commandMenuItem rows exist and are unique in the workspace's metadata.
- Repair or remove duplicates/half-edited rows, then re-run the upgrade.
- Rebuild the image if the standard seed for these commandMenuItem rows is missing.
Defensive patterns
Strategy: validation
Validate before calling
// Confirm the targeted CallRecording commandMenuItem rows exist and are unique.
const rows = await dataSource.query(`
SELECT "universalIdentifier", count(*) FROM core."commandMenuItem"
WHERE "universalIdentifier" = ANY($1::text[])
GROUP BY "universalIdentifier"
`, [targetIdentifiers]);
const dupes = rows.filter((r: any) => r.count > 1);
if (dupes.length) throw new Error(`Duplicate commandMenuItem rows: ${JSON.stringify(dupes)}`); Type guard
function isFailResult(r: unknown): r is { status: 'fail' } {
return typeof r === 'object' && r !== null && (r as any).status === 'fail';
} Try / catch
try {
const res = await service.validateBuildAndRunLegacyWorkspaceMigration(payload);
if (res.status === 'fail') throw new Error(`... for workspace ${workspaceId}`);
} catch (err) { upgradeAudit.record(workspaceId, command.id, err); throw err; } Prevention
- Never half-edit commandMenuItem rows outside the migration framework.
- Verify availability-expression schema compliance before payload submission.
- Deploy matching standard seed and command code in one image.
When it happens
Trigger: Running the 2.17 upgrade where the commandMenuItem universal identifiers targeted by this command are missing, duplicated, or referenced by an availability expression payload that fails validation (e.g. malformed expression, unknown context, dangling reference).
Common situations: Standard commandMenuItem seed drift between image and workspace; a prior partial migration that left duplicate or half-updated commandMenuItem rows; custom command menu edits conflicting with the availability expression schema.
Related errors
- Failed to create CallRecording recordingRequestStatus metada
- Failed to sync CallRecording status metadata for workspace $
- Failed to rename CallRecording name collision for workspace
- Failed to create CallRecording standard objects for workspac
- Migration failed for workspace ${workspaceId} while healing
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/feff70f4a0b275c0.
Report an issue: GitHub.