{"record":{"id":"13b8ce6d1d72db32","repo":"twentyhq/twenty","slug":"failed-to-backfill-standard-skills-for-workspace-13b8ce","errorCode":null,"errorMessage":"Failed to backfill standard skills for workspace ${workspaceId}","messagePattern":"Failed to backfill standard skills for workspace (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-27/2-27-workspace-command-1785499350000-backfill-standard-skills.command.ts","lineNumber":110,"sourceCode":"          allFlatEntityOperationByMetadataName: {\n            skill: {\n              flatEntityToCreate: skillsToCreate,\n              flatEntityToDelete: [],\n              flatEntityToUpdate: [],\n            },\n          },\n          workspaceId,\n          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n        },\n      );\n\n    if (validateAndBuildResult.status === 'fail') {\n      this.logger.error(\n        `Failed to backfill standard skills:\\n${JSON.stringify(validateAndBuildResult, null, 2)}`,\n      );\n\n      throw new Error(\n        `Failed to backfill standard skills for workspace ${workspaceId}`,\n      );\n    }\n\n    this.logger.log(\n      `Successfully created ${skillsToCreate.length} standard skill(s) for workspace ${workspaceId}`,\n    );\n  }\n}\n","sourceCodeStart":92,"sourceCodeEnd":120,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-27/2-27-workspace-command-1785499350000-backfill-standard-skills.command.ts#L92-L120","documentation":"Thrown by the 2.27 command that backfills standard Skills into existing workspaces. It builds skill flat entities and submits them via validateBuildAndRunLegacyWorkspaceMigration; on status === 'fail' it logs the full report then throws. The failure is in the skill flat-entity operations — the orchestrator's report (nested under the logged JSON) identifies which skill(s) and which validation rule failed.","triggerScenarios":"A skill flat entity references an application/object/field universalIdentifier that does not exist in the target workspace; a skill universalIdentifier already exists with a different shape (collision); a dependent relation or workflow node references a skill that the validator cannot resolve; the twentyStandardFlatApplication record is missing or mislinked for the workspace.","commonSituations":"Workspace created on an older release where the standard application seed diverged from current code; partial earlier skill seeding that left half-written rows; cross-version upgrade skipping intermediate releases so dependent metadata (objects the skills reference) is absent.","solutions":["Inspect the logged JSON report (this command logs it via logger.error before throwing) — find the failing skill universalIdentifier and the error code.","Verify the referenced application and any object/field identifiers the skill depends on exist for the workspace (query core.metadata).","Remove or repair colliding/dangling skill rows for that workspace, then re-run the 2.27 command.","If upgrading across many skipped versions, run the intermediate major upgrades first so all dependent metadata exists."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await command.runOnWorkspace({ workspaceId, options });\n} catch (e) {\n  // the command logs the full report via logger.error before throwing;\n  // capture workspaceId and continue the per-workspace loop.\n  upgradeRunner.markWorkspaceFailed(workspaceId, e);\n}","preventionTips":["Run intermediate major-version upgrades so all objects/fields the skills reference already exist.","Ensure the twentyStandardFlatApplication record exists and is linked for each workspace before the 2.27 upgrade.","Read the logged report to find the failing skill universalIdentifier before retrying."],"tags":["migration","upgrade-command","validate-and-build","workspace","skills","orchestrator"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}