{"record":{"id":"6b513ca7d6933931","repo":"twentyhq/twenty","slug":"failed-to-create-standard-record-page-layouts-for","errorCode":null,"errorMessage":"Failed to create standard record page layouts for workspace ${workspaceId}","messagePattern":"Failed to create standard record page layouts for workspace (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts","lineNumber":448,"sourceCode":"              flatEntityToUpdate: [],\n            },\n            viewFieldGroup: {\n              flatEntityToCreate: viewFieldGroups,\n              flatEntityToDelete: [],\n              flatEntityToUpdate: [],\n            },\n          },\n          workspaceId,\n          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n        },\n      );\n\n    if (result.status === 'fail') {\n      this.logger.error(\n        `Failed to create standard record page layouts:\\n${JSON.stringify(result, null, 2)}`,\n      );\n      throw new Error(\n        `Failed to create standard record page layouts for workspace ${workspaceId}`,\n      );\n    }\n  }\n\n  private async createCustomObjectPageLayouts({\n    workspaceId,\n    twentyStandardFlatApplication,\n  }: {\n    workspaceId: string;\n    twentyStandardFlatApplication: FlatApplication;\n  }): Promise<void> {\n    const {\n      flatObjectMetadataMaps,\n      flatFieldMetadataMaps,\n      flatPageLayoutMaps,\n    } = await this.workspaceCacheService.getOrRecompute(workspaceId, [\n      'flatObjectMetadataMaps',","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts#L430-L466","documentation":"Thrown inside the 1.23 backfill command's standard-layout create step when validateBuildAndRunLegacyWorkspaceMigration returns 'fail' while creating standard record page layouts. The command logs the result JSON, then throws to abort the workspace upgrade.","triggerScenarios":"Running the 1.23 standard record page layout creation on a workspace where the referenced standard objects/sections are missing from cache, or the layout batch duplicates existing layouts the validator rejects.","commonSituations":"Stale workspace cache so standard objects resolve to nothing; partial prior run already created some layouts (duplicates); standard flat application version mismatch.","solutions":["Inspect the logged result JSON for the specific create rejection.","Recompute the workspace cache and re-run.","Run --dryRun to preview the standard layouts to create.","Confirm the twenty-standard flat application for the workspace matches the build."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Dry-run to preview standard layouts to create, and confirm standard objects exist in cache:\nawait workspaceCacheService.invalidate(workspaceId);\nconst { flatObjectMetadataMaps } = await workspaceCacheService.getOrRecompute(workspaceId, ['flatObjectMetadataMaps']);\nconst missingObjects = REQUIRED_STANDARD_OBJECT_IDS.filter((id) => !isDefined(flatObjectMetadataMaps.byUniversalIdentifier[id]));\nif (missingObjects.length > 0) throw new Error(`Missing standard objects: ${missingObjects.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await command.runOnWorkspace({ workspaceId, options });\n} catch (err) {\n  logger.error(`Standard record page layout create failed for workspace ${workspaceId}`, err);\n  failedWorkspaces.push(workspaceId);\n}","preventionTips":["Run --dryRun to confirm planned standard layouts.","Recompute the cache so referenced standard objects resolve.","Verify the twenty-standard flat application matches the build.","Catch per-workspace at the runner."],"tags":["migration","workspace-upgrade","record-page-layout","create"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}