twentyhq/twenty · critical · Error
Failed to create the workspaceMember openRecordIn field for
Error message
Failed to create the workspaceMember openRecordIn field for workspace ${workspaceId} What it means
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.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-27/2-27-workspace-command-1785505000000-add-workspace-member-open-record-in.command.ts:136
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
workspaceId,
allFlatEntityOperationByMetadataName: {
fieldMetadata: {
flatEntityToCreate: fieldsToCreate,
flatEntityToDelete: [],
flatEntityToUpdate: [],
},
},
},
);
if (result.status === 'fail') {
this.logger.error(
`Failed to create the workspaceMember openRecordIn field:\n${JSON.stringify(result, null, 2)}`,
);
throw new Error(
`Failed to create the workspaceMember openRecordIn field for workspace ${workspaceId}`,
);
}
this.logger.log(
`Created the workspaceMember openRecordIn field for workspace ${workspaceId}`,
);
}
}
View on GitHub (pinned to 1f5dd2bbd2)
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.
Defensive patterns
Strategy: validation
Validate before calling
// Pre-check the field does not already exist in a bad shape:
const existing = flatFieldMetadataMaps.byUniversalIdentifier[OPEN_RECORD_IN_UI];
if (isDefined(existing) && existing.objectMetadataUniversalIdentifier !== WORKSPACE_MEMBER_UI) {
// reconcile before running the 2.27 command
} Try / catch
try {
await command.runOnWorkspace({ workspaceId, options });
} catch (e) {
logger.error({ workspaceId, err: e.message }, 'openRecordIn create failed');
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Failed to backfill imageIdentifierFieldMetadataId for worksp
- Failed to delete message.direction field for workspace ${wor
- Failed to add NOT_RECORDED to CallRecording status metadata
- Failed to backfill standard skills for workspace ${workspace
- Failed to seed object openRecordIn for workspace ${workspace
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/04054fb8d4abe0c4.
Report an issue: GitHub.