{"record":{"id":"e53e1758f29b413e","repo":"twentyhq/twenty","slug":"failed-to-add-the-block-settings-command-menu-item","errorCode":null,"errorMessage":"Failed to add the Block Settings command menu item for workspace ${workspaceId}: ${JSON.stringify(validateAndBuildResult, null, 2)}","messagePattern":"Failed to add the Block Settings command menu item for workspace (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-28/2-28-workspace-command-1785921674941-add-email-block-settings-command-menu-item.command.ts","lineNumber":126,"sourceCode":"    const validateAndBuildResult =\n      await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(\n        {\n          isSystemBuild: true,\n          allFlatEntityOperationByMetadataName: {\n            commandMenuItem: {\n              flatEntityToCreate: [itemToCreate],\n              flatEntityToDelete: [],\n              flatEntityToUpdate: [],\n            },\n          },\n          workspaceId,\n          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n        },\n      );\n\n    if (validateAndBuildResult.status === 'fail') {\n      throw new Error(\n        `Failed to add the Block Settings command menu item for workspace ${workspaceId}: ${JSON.stringify(\n          validateAndBuildResult,\n          null,\n          2,\n        )}`,\n      );\n    }\n\n    this.logger.log(\n      `Added the Block Settings command menu item for workspace ${workspaceId}`,\n    );\n  }\n}\n","sourceCodeStart":108,"sourceCodeEnd":140,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-28/2-28-workspace-command-1785921674941-add-email-block-settings-command-menu-item.command.ts#L108-L140","documentation":"Thrown by the same 2.28 command (add-email-block-settings-command-menu-item) after it submits the Block Settings command menu item for creation via validateBuildAndRunLegacyWorkspaceMigration and gets status === 'fail'. The thrown message embeds the full orchestrator failed result, whose report lists the failing command-menu-item validation(s).","triggerScenarios":"A command menu item with EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER already exists under a different shape (collision the early idempotency check did not catch); the item references a section/availability expression/object that is absent in the workspace; the generated migration cannot place the item at the requested position.","commonSituations":"An earlier partial run created the item partially; the standard definition's position/section references a navigation section absent in an older workspace; cross-version upgrade skipping the command that defines the target section.","solutions":["Parse the JSON report in the thrown message to find the failing validation code and entity.","Resolve the collision/dangling reference (remove the stray item row or seed the missing section).","Invalidate the workspace cache and re-run the 2.28 command."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await command.runOnWorkspace({ workspaceId, options });\n} catch (e) {\n  const report = JSON.parse(e.message.split(':').slice(1).join(':').trim());\n  logger.error({ workspaceId, report }, 'Block Settings item create failed');\n}","preventionTips":["Ensure the navigation section the item targets exists in the workspace.","Remove partially-created item rows before retrying.","Read the embedded report to find the blocking validation."],"tags":["migration","upgrade-command","validate-and-build","workspace","command-menu-item","orchestrator"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}