twentyhq/twenty · error · Error
Failed to backfill imageIdentifierFieldMetadataId for worksp
Error message
Failed to backfill imageIdentifierFieldMetadataId for workspace ${workspaceId} What it means
Thrown by the 2.3 command that backfills imageIdentifierFieldMetadataId on the workspaceMember object. It runs the field-metadata update via validateBuildAndRunLegacyWorkspaceMigration (isSystemBuild: true); on status === 'fail' it logs the report and throws. The failure is in validating/applying the workspaceMember field update that stores the image field reference.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-3/2-3-workspace-command-1777920000000-backfill-image-identifier-field-metadata-id.command.ts:130
imageIdentifierFieldMetadataUniversalIdentifier:
AVATAR_URL_FIELD_UNIVERSAL_IDENTIFIER,
},
],
},
},
workspaceId,
isSystemBuild: true,
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
},
);
if (validateAndBuildResult.status === 'fail') {
this.logger.error(
`Failed to backfill imageIdentifierFieldMetadataId for workspace ${workspaceId}:\n${JSON.stringify(validateAndBuildResult, null, 2)}`,
);
throw new Error(
`Failed to backfill imageIdentifierFieldMetadataId for workspace ${workspaceId}`,
);
}
this.logger.log(
`Backfilled imageIdentifierFieldMetadataId on workspaceMember for workspace ${workspaceId}`,
);
}
}
View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Inspect the logged JSON report for the failing field and error code.
- Ensure the workspaceMember image field exists and is active (re-seed it if missing).
- Clear any stale imageIdentifierFieldMetadataId value, then re-run the 2.3 command.
Defensive patterns
Strategy: validation
Validate before calling
// Confirm the image field referenced exists on workspaceMember:
const imageField = flatFieldMetadataMaps.byUniversalIdentifier[WORKSPACE_MEMBER_IMAGE_UI];
if (!isDefined(imageField)) { /* seed it first */ } Try / catch
try {
await command.runOnWorkspace({ workspaceId, options });
} catch (e) {
logger.error({ workspaceId, err: e.message }, 'imageIdentifierFieldMetadataId backfill failed');
} Prevention
- Run the upgrade that creates the workspaceMember image field before the 2.3 backfill.
- Clear stale imageIdentifierFieldMetadataId values pointing at soft-deleted fields.
When it happens
Trigger: The image field referenced by imageIdentifierFieldMetadataId does not exist on workspaceMember; the workspaceMember object is absent or deactivated; the referenced field id is a dangling FK (field was soft-deleted); the column already holds a value failing a uniqueness/format check.
Common situations: Workspace on an old release where the workspaceMember image field was never seeded or was removed; cross-version upgrade skipping the command that creates the image field; soft-deleted field metadata leaving a stale id.
Related errors
- Failed to create the workspaceMember openRecordIn field for
- Failed to delete message.direction field for workspace ${wor
- Failed to persist relation join column index metadata for wo
- Failed to add NOT_RECORDED to CallRecording status metadata
- Failed to backfill standard skills for workspace ${workspace
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/76bf24fbbc8185f1.
Report an issue: GitHub.