twentyhq/twenty · error · Error

Failed to create inactive generic standard fields for worksp

Error message

Failed to create inactive generic standard fields for workspace ${workspaceId}

What it means

Thrown by the 2.10 workspace upgrade command when validateBuildAndRunLegacyWorkspaceMigration returns 'fail' while creating inactive generic standard fields. The failure JSON is logged before the throw so the operator can see why the field create batch was rejected.

Source

Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000050000-add-inactive-generic-standard-fields.command.ts:173

          allFlatEntityOperationByMetadataName: {
            fieldMetadata: {
              flatEntityToCreate: fieldsToCreate,
              flatEntityToDelete: [],
              flatEntityToUpdate: [],
            },
          },
          workspaceId,
          applicationUniversalIdentifier:
            twentyStandardFlatApplication.universalIdentifier,
        },
      );

    if (validateAndBuildResult.status === 'fail') {
      this.logger.error(
        `Failed to create inactive generic standard fields:\n${JSON.stringify(validateAndBuildResult, null, 2)}`,
      );

      throw new Error(
        `Failed to create inactive generic standard fields for workspace ${workspaceId}`,
      );
    }

    this.logger.log(
      `Successfully created ${fieldsToCreate.length} inactive standard field(s) for workspace ${workspaceId}`,
    );
  }
}

View on GitHub (pinned to 1f5dd2bbd2)

Solutions

  1. Inspect the logged validateAndBuildResult JSON for the precise create rejection.
  2. Recompute the workspace cache and retry.
  3. Run --dryRun to preview fieldsToCreate and confirm none already exist.
  4. Verify the standard field set in the installed build matches what the command expects.
Defensive patterns

Strategy: validation

Validate before calling

// Dry-run to preview inactive fields to create, and confirm target standard objects exist:
await workspaceCacheService.invalidate(workspaceId);
const { flatObjectMetadataMaps } = await workspaceCacheService.getOrRecompute(workspaceId, ['flatObjectMetadataMaps']);
const missingObjects = REQUIRED_OBJECT_IDS.filter((id) => !isDefined(flatObjectMetadataMaps.byUniversalIdentifier[id]));
if (missingObjects.length > 0) throw new Error(`Target objects missing: ${missingObjects.join(', ')}`);

Try / catch

try {
  await command.runOnWorkspace({ workspaceId, options });
} catch (err) {
  logger.error(`Inactive standard field creation failed for workspace ${workspaceId}`, err);
  failedWorkspaces.push(workspaceId);
}

Prevention

When it happens

Trigger: Running the 2.10 inactive-standard-field creation on a workspace where the target standard object is missing from cache, or the new fields duplicate existing field names/universal identifiers the validator forbids.

Common situations: Stale cache so the target object resolves to nothing; a prior partial run already created some of the inactive fields (duplicates); standard field definitions changed between builds.

Related errors


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