{"record":{"id":"e6600427046a97b1","repo":"twentyhq/twenty","slug":"standard-application-is-missing-messagecampaign-vi","errorCode":null,"errorMessage":"Standard application is missing messageCampaign view column ${universalIdentifier}","messagePattern":"Standard application is missing messageCampaign view column (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-20/2-20-workspace-command-1783525261000-add-message-campaign-stat-fields.command.ts","lineNumber":137,"sourceCode":"    });\n\n    const viewsToCreate = this.resolveViewsToCreate({\n      flatViewMaps,\n      standardAllFlatEntityMaps,\n    });\n\n    const viewFieldsToCreate = CAMPAIGN_VIEW_FIELD_UNIVERSAL_IDENTIFIERS.filter(\n      (universalIdentifier) =>\n        !isDefined(flatViewFieldMaps.byUniversalIdentifier[universalIdentifier]),\n    ).flatMap((universalIdentifier) => {\n      const standardViewField =\n        findFlatEntityByUniversalIdentifier<FlatViewField>({\n          flatEntityMaps: standardAllFlatEntityMaps.flatViewFieldMaps,\n          universalIdentifier,\n        });\n\n      if (!isDefined(standardViewField)) {\n        throw new Error(\n          `Standard application is missing messageCampaign view column ${universalIdentifier}`,\n        );\n      }\n\n      const fieldUniversalIdentifier =\n        standardAllFlatEntityMaps.flatFieldMetadataMaps.universalIdentifierById[\n          standardViewField.fieldMetadataId\n        ];\n\n      if (!isDefined(fieldUniversalIdentifier)) {\n        return [];\n      }\n\n      // The standard column list keeps growing after 2.20, so skip columns whose\n      // field a later command introduces and backfills.\n      const isFieldAvailable =\n        isDefined(\n          flatFieldMetadataMaps.byUniversalIdentifier[fieldUniversalIdentifier],","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-20/2-20-workspace-command-1783525261000-add-message-campaign-stat-fields.command.ts#L119-L155","documentation":"Thrown by the 2.20 add-message-campaign-stat-fields command when a messageCampaign view-column universal identifier (from the missing-view-field list) is not found in the standard application's flatViewFieldMaps via findFlatEntityByUniversalIdentifier. The command builds viewFieldsToCreate from the standard's view-field definitions; absence means the standard seed does not contain those view columns.","triggerScenarios":"Running the 2.20 upgrade from an image whose standard seed predates or omits the messageCampaign view columns the command expects. Note this runs after the field check (134), so the fields exist but the view-column definitions are missing.","commonSituations":"Code+seed mismatch where the field seed was updated but the view-column seed was not; partial deployment; loading the wrong standard application.","solutions":["Confirm the standard seed defines the missing messageCampaign view-column universal identifiers (grep the seed).","Rebuild and redeploy the image with the matching view-column seed.","Verify the standard application loads correctly.","Re-run the upgrade after redeployment."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight: confirm the standard seed defines all messageCampaign view columns.\nconst missing = CAMPAIGN_VIEW_FIELD_UNIVERSAL_IDENTIFIERS.filter(\n  (id) => !isDefined(standardAllFlatEntityMaps.flatViewFieldMaps.byUniversalIdentifier[id]),\n);\nif (missing.length) {\n  throw new Error(`Image standard seed lacks messageCampaign view columns: ${missing.join(', ')}; rebuild and redeploy.`);\n}","typeGuard":"import { isDefined } from '@twenty/shared';\n\nfunction standardDefinesAllViewFields(\n  maps: { byUniversalIdentifier: Record<string, unknown> },\n  ids: string[],\n): boolean {\n  return ids.every((id) => isDefined(maps.byUniversalIdentifier[id]));\n}","tryCatchPattern":null,"preventionTips":["Build image from a single commit so the field seed and view-column seed ship together.","Preflight all referenced standard view-field identifiers before upgrade.","Never cherry-pick a command without its seed updates."],"tags":["migration","workspace-upgrade","standard-seed","missing-metadata","view-field","message-campaign"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}