{"record":{"id":"f26c5d6072a46490","repo":"twentyhq/twenty","slug":"failed-to-create-inactive-generic-standard-fields","errorCode":null,"errorMessage":"Failed to create inactive generic standard fields for workspace ${workspaceId}","messagePattern":"Failed to create inactive generic standard fields for workspace (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000050000-add-inactive-generic-standard-fields.command.ts","lineNumber":173,"sourceCode":"          allFlatEntityOperationByMetadataName: {\n            fieldMetadata: {\n              flatEntityToCreate: fieldsToCreate,\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 create inactive generic standard fields:\\n${JSON.stringify(validateAndBuildResult, null, 2)}`,\n      );\n\n      throw new Error(\n        `Failed to create inactive generic standard fields for workspace ${workspaceId}`,\n      );\n    }\n\n    this.logger.log(\n      `Successfully created ${fieldsToCreate.length} inactive standard field(s) for workspace ${workspaceId}`,\n    );\n  }\n}\n","sourceCodeStart":155,"sourceCodeEnd":183,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-10/2-10-workspace-command-1799000050000-add-inactive-generic-standard-fields.command.ts#L155-L183","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the logged validateAndBuildResult JSON for the precise create rejection.","Recompute the workspace cache and retry.","Run --dryRun to preview fieldsToCreate and confirm none already exist.","Verify the standard field set in the installed build matches what the command expects."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Dry-run to preview inactive fields to create, and confirm target standard objects exist:\nawait workspaceCacheService.invalidate(workspaceId);\nconst { flatObjectMetadataMaps } = await workspaceCacheService.getOrRecompute(workspaceId, ['flatObjectMetadataMaps']);\nconst missingObjects = REQUIRED_OBJECT_IDS.filter((id) => !isDefined(flatObjectMetadataMaps.byUniversalIdentifier[id]));\nif (missingObjects.length > 0) throw new Error(`Target objects missing: ${missingObjects.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try {\n  await command.runOnWorkspace({ workspaceId, options });\n} catch (err) {\n  logger.error(`Inactive standard field creation failed for workspace ${workspaceId}`, err);\n  failedWorkspaces.push(workspaceId);\n}","preventionTips":["Run --dryRun to confirm fieldsToCreate and that none already exist.","Verify the standard field set in the build matches the command's expectations.","Recompute the cache before running.","Catch per-workspace at the runner."],"tags":["migration","workspace-upgrade","field-metadata","standard-fields"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}