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

  1. Read the logged validateAndBuildResult JSON for the precise rejection.
  2. Recompute the workspace cache and retry the command for that workspace.
  3. Run --dryRun to preview skillsToCreate and confirm none already exist.
  4. 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

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


AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12). Data as JSON: /api/errors/a32e4caff9a089a1. Report an issue: GitHub.