twentyhq/twenty · error · Error
Failed to backfill standard skills for workspace ${workspace
Error message
Failed to backfill standard skills for workspace ${workspaceId} What it means
Thrown by the 1.22 workspace upgrade command when validateBuildAndRunLegacyWorkspaceMigration returns 'fail' while backfilling standard skills for a workspace. The command logs the full failure JSON then throws to stop the upgrade for that workspace.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/1-22/1-22-workspace-command-1780000002000-backfill-standard-skills.command.ts:110
allFlatEntityOperationByMetadataName: {
skill: {
flatEntityToCreate: skillsToCreate,
flatEntityToDelete: [],
flatEntityToUpdate: [],
},
},
workspaceId,
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
},
);
if (validateAndBuildResult.status === 'fail') {
this.logger.error(
`Failed to backfill standard skills:\n${JSON.stringify(validateAndBuildResult, null, 2)}`,
);
throw new Error(
`Failed to backfill standard skills for workspace ${workspaceId}`,
);
}
this.logger.log(
`Successfully created ${skillsToCreate.length} standard skill(s) for workspace ${workspaceId}`,
);
}
}
View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Read the logged validateAndBuildResult JSON for the precise rejection.
- Recompute the workspace cache and retry the command for that workspace.
- Run --dryRun to preview skillsToCreate and confirm none already exist.
- Verify the twenty-standard flat application for the workspace matches the build's STANDARD skills constant.
Defensive patterns
Strategy: validation
Validate before calling
// Dry-run to preview skillsToCreate, and confirm the standard skills constant is non-empty for this build:
await workspaceCacheService.invalidate(workspaceId);
if (STANDARD_SKILLS.length === 0) throw new Error('No standard skills defined in this build; aborting backfill'); Try / catch
try {
await command.runOnWorkspace({ workspaceId, options });
} catch (err) {
logger.error(`Standard skills backfill failed for workspace ${workspaceId}`, err);
failedWorkspaces.push(workspaceId);
} Prevention
- Run --dryRun to confirm skillsToCreate is non-empty and targets missing skills.
- Recompute the workspace cache before running so existing-skill detection is accurate.
- Verify the build's standard skills constant matches the server version.
- Isolate per-workspace failures at the runner.
When it happens
Trigger: Running the 1.22 standard-skills backfill on a workspace whose skill metadata or referenced application flat entities are missing or malformed, causing the migration builder to reject the skillsToCreate batch.
Common situations: Stale workspace cache so standard skill definitions resolve to nothing; skills already partially created in a prior aborted run producing duplicates; twenty-standard-application metadata version mismatch with the installed server build.
Related errors
- Failed to persist searchFieldMetadata rows for workspace ${w
- Failed to update search command menu item labels for workspa
- Failed to add Send Email record-selection commands for works
- Failed to fix merge command menu item expression for workspa
- Failed to delete record page layout entities for workspace $
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/a32e4caff9a089a1.
Report an issue: GitHub.