{"record":{"id":"04054fb8d4abe0c4","repo":"twentyhq/twenty","slug":"failed-to-create-the-workspacemember-openrecordin","errorCode":null,"errorMessage":"Failed to create the workspaceMember openRecordIn field for workspace ${workspaceId}","messagePattern":"Failed to create the workspaceMember openRecordIn field 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-1785505000000-add-workspace-member-open-record-in.command.ts","lineNumber":136,"sourceCode":"          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n          workspaceId,\n          allFlatEntityOperationByMetadataName: {\n            fieldMetadata: {\n              flatEntityToCreate: fieldsToCreate,\n              flatEntityToDelete: [],\n              flatEntityToUpdate: [],\n            },\n          },\n        },\n      );\n\n    if (result.status === 'fail') {\n      this.logger.error(\n        `Failed to create the workspaceMember openRecordIn field:\\n${JSON.stringify(result, null, 2)}`,\n      );\n\n      throw new Error(\n        `Failed to create the workspaceMember openRecordIn field for workspace ${workspaceId}`,\n      );\n    }\n\n    this.logger.log(\n      `Created the workspaceMember openRecordIn field for workspace ${workspaceId}`,\n    );\n  }\n}\n","sourceCodeStart":118,"sourceCodeEnd":146,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-27/2-27-workspace-command-1785505000000-add-workspace-member-open-record-in.command.ts#L118-L146","documentation":"Thrown by the 2.27 command that creates the workspaceMember.openRecordIn field. After submitting the field-metadata create operation through validateBuildAndRunLegacyWorkspaceMigration and getting status === 'fail', it logs the result then throws. The embedded report points at the specific flat-field validation that rejected the new field.","triggerScenarios":"The openRecordIn field universalIdentifier already exists on workspaceMember under a different type/label (collision); the workspaceMember object metadata is missing or deactivated so the field cannot attach; a relation referenced by the field's settings is absent; the column the field maps to already exists in the workspace schema with an incompatible type.","commonSituations":"A workspace where openRecordIn was manually added or partially seeded; workspaceMember object was renamed/deleted by a custom migration; schema column name collision from a prior field that was soft-deleted but not dropped.","solutions":["Read the logged JSON report to find which validation rule rejected the field create.","Check whether openRecordIn already exists on workspaceMember for the workspace and, if it does in a bad shape, correct or remove it so the create is idempotent.","Confirm the workspaceMember object is present and active in the workspace metadata.","Re-run the 2.27 workspace command once the conflict clears."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-check the field does not already exist in a bad shape:\nconst existing = flatFieldMetadataMaps.byUniversalIdentifier[OPEN_RECORD_IN_UI];\nif (isDefined(existing) && existing.objectMetadataUniversalIdentifier !== WORKSPACE_MEMBER_UI) {\n  // reconcile before running the 2.27 command\n}","typeGuard":null,"tryCatchPattern":"try {\n  await command.runOnWorkspace({ workspaceId, options });\n} catch (e) {\n  logger.error({ workspaceId, err: e.message }, 'openRecordIn create failed');\n}","preventionTips":["Confirm the workspaceMember object is present and active before upgrading.","Avoid manually seeding openRecordIn; let the command own it.","On partial failure, remove the half-created field row before retrying."],"tags":["migration","upgrade-command","validate-and-build","workspace","field-metadata","workspace-member"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}