twentyhq/twenty · error · Error
Failed to create custom object page layouts for workspace ${
Error message
Failed to create custom object page layouts for workspace ${workspaceId} What it means
Thrown inside the 1.23 backfill command's custom-object-layout create step when validateBuildAndRunLegacyWorkspaceMigration returns 'fail' while creating page layouts for custom objects. The result JSON is logged first; this is the final step of the command so the throw ends the workspace run.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/1-23/1-23-workspace-command-1780000001500-backfill-record-page-layouts.command.ts:591
flatEntityToUpdate: [],
},
viewField: {
flatEntityToCreate: allViewFields,
flatEntityToDelete: [],
flatEntityToUpdate: [],
},
},
workspaceId,
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
},
);
if (result.status === 'fail') {
this.logger.error(
`Failed to create custom object page layouts:\n${JSON.stringify(result, null, 2)}`,
);
throw new Error(
`Failed to create custom object page layouts for workspace ${workspaceId}`,
);
}
}
}
View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Read the logged result JSON for the precise rejection.
- Recompute the workspace cache and retry.
- Run --dryRun to inspect planned custom-object layouts.
- Reconcile any deleted custom objects in the failing workspace.
Defensive patterns
Strategy: validation
Validate before calling
// Dry-run to preview custom-object layouts, and confirm custom objects exist in cache:
await workspaceCacheService.invalidate(workspaceId);
const { flatObjectMetadataMaps } = await workspaceCacheService.getOrRecompute(workspaceId, ['flatObjectMetadataMaps']);
const customObjects = Object.values(flatObjectMetadataMaps.byUniversalIdentifier).filter((o) => isDefined(o) && o.isCustom);
if (customObjects.length === 0) throw new Error('No custom objects found; nothing to create layouts for'); Try / catch
try {
await command.runOnWorkspace({ workspaceId, options });
} catch (err) {
logger.error(`Custom object page layout create failed for workspace ${workspaceId}`, err);
failedWorkspaces.push(workspaceId);
} Prevention
- Run --dryRun to confirm planned custom-object layouts.
- Recompute the cache so custom objects resolve.
- Reconcile any deleted custom objects before running.
- Catch per-workspace at the runner.
When it happens
Trigger: Running the 1.23 backfill on a workspace whose custom objects are missing from cache or whose layout batch duplicates existing custom-object layouts the validator rejects.
Common situations: Stale cache missing custom objects; partial prior run created some custom layouts already; custom object referenced by the layout was deleted mid-upgrade.
Related errors
- Failed to delete record page layout entities for workspace $
- Failed to create standard record page layouts for workspace
- Failed to update search command menu item labels for workspa
- Failed to add Send Email record-selection commands for works
- Failed to backfill standard skills for workspace ${workspace
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/18275827a1fcd1b3.
Report an issue: GitHub.