{"record":{"id":"feff70f4a0b275c0","repo":"twentyhq/twenty","slug":"failed-to-sync-callrecording-navigation-command-me","errorCode":null,"errorMessage":"Failed to sync CallRecording navigation command menu item availability expression for workspace ${workspaceId}","messagePattern":"Failed to sync CallRecording navigation command menu item availability expression for workspace (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"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","lineNumber":91,"sourceCode":"    const validateAndBuildResult =\n      await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(\n        {\n          isSystemBuild: true,\n          workspaceId,\n          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n          allFlatEntityOperationByMetadataName: {\n            commandMenuItem: commandMenuItemOperations,\n          },\n        },\n      );\n\n    if (validateAndBuildResult.status === 'fail') {\n      this.logger.error(\n        `Failed to sync CallRecording navigation command menu item availability expression:\\n${JSON.stringify(validateAndBuildResult, null, 2)}`,\n      );\n\n      throw new Error(\n        `Failed to sync CallRecording navigation command menu item availability expression for workspace ${workspaceId}`,\n      );\n    }\n\n    this.logger.log(\n      `Successfully synced ${commandMenuItemsToUpdate.length} CallRecording navigation command menu item availability expression(s) for workspace ${workspaceId}`,\n    );\n  }\n}\n","sourceCodeStart":73,"sourceCodeEnd":101,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/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#L73-L101","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm the targeted CallRecording commandMenuItem rows exist and are unique.\nconst rows = await dataSource.query(`\n  SELECT \"universalIdentifier\", count(*) FROM core.\"commandMenuItem\"\n  WHERE \"universalIdentifier\" = ANY($1::text[])\n  GROUP BY \"universalIdentifier\"\n`, [targetIdentifiers]);\nconst dupes = rows.filter((r: any) => r.count > 1);\nif (dupes.length) throw new Error(`Duplicate commandMenuItem rows: ${JSON.stringify(dupes)}`);","typeGuard":"function isFailResult(r: unknown): r is { status: 'fail' } {\n  return typeof r === 'object' && r !== null && (r as any).status === 'fail';\n}","tryCatchPattern":"try {\n  const res = await service.validateBuildAndRunLegacyWorkspaceMigration(payload);\n  if (res.status === 'fail') throw new Error(`... for workspace ${workspaceId}`);\n} catch (err) { upgradeAudit.record(workspaceId, command.id, err); throw err; }","preventionTips":["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."],"tags":["migration","workspace-upgrade","metadata-validation","command-menu","call-recording"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}