{"record":{"id":"9c4bec3c74995428","repo":"twentyhq/twenty","slug":"failed-to-update-the-message-campaign-record-page","errorCode":null,"errorMessage":"Failed to update the message campaign record page for workspace ${workspaceId}: ${JSON.stringify(validateAndBuildResult, null, 2)}","messagePattern":"Failed to update the message campaign record page for workspace (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786456707000-trim-message-campaign-record-page.command.ts","lineNumber":159,"sourceCode":"    const validateAndBuildResult =\n      await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(\n        {\n          isSystemBuild: true,\n          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n          workspaceId,\n          allFlatEntityOperationByMetadataName: {\n            pageLayoutWidget: {\n              flatEntityToCreate: [],\n              flatEntityToDelete: pageLayoutWidgetsToDelete,\n              flatEntityToUpdate: pageLayoutWidgetsToUpdate,\n            },\n          },\n        },\n      );\n\n    if (validateAndBuildResult.status === 'fail') {\n      throw new Error(\n        `Failed to update the message campaign record page for workspace ${workspaceId}: ${JSON.stringify(\n          validateAndBuildResult,\n          null,\n          2,\n        )}`,\n      );\n    }\n\n    this.logger.log(\n      `Updated the message campaign record page for workspace ${workspaceId}`,\n    );\n  }\n}\n","sourceCodeStart":141,"sourceCodeEnd":173,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786456707000-trim-message-campaign-record-page.command.ts#L141-L173","documentation":"Thrown by the 2.31 command that trims the message campaign record page (deletes and updates page-layout widgets). It submits the operations via validateBuildAndRunLegacyWorkspaceMigration; on status === 'fail' it throws with the full report embedded. The report identifies which widget delete/update failed.","triggerScenarios":"A page-layout widget targeted for delete no longer exists (already removed); a widget targeted for update references a view/field that is gone; the message campaign record page layout itself is missing or was replaced by a custom one.","commonSituations":"A prior run partially trimmed the page; a custom message campaign layout diverged from the standard; cross-version upgrade where the base page was never seeded.","solutions":["Read the embedded JSON report to find the failing widget operation and error code.","Reconcile missing widgets (remove orphan references) or re-seed the message campaign record page.","Re-run the 2.31 command for the workspace."],"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 }, 'message campaign record page trim failed');\n}","preventionTips":["Ensure the message campaign record page layout exists before trimming.","Remove orphaned widget references before retrying."],"tags":["migration","upgrade-command","validate-and-build","workspace","page-layout-widget","message-campaign","record-page"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}