twentyhq/twenty · critical · Error
Standard application is missing the Message isDraft field me
Error message
Standard application is missing the Message isDraft field metadata
What it means
Thrown by the 2.18 command that adds the Message.isDraft field when findFlatEntityByUniversalIdentifier cannot locate MESSAGE_IS_DRAFT_FIELD_UNIVERSAL_IDENTIFIER in the bundled standard application's flatFieldMetadataMaps. This is a seed/code-image failure, not a per-workspace data failure: the standard definition itself does not contain the field this command was written to provision.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-18/2-18-workspace-command-1810000005000-add-message-is-draft-field.command.ts:96
await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
{ workspaceId },
);
const { allFlatEntityMaps: standardAllFlatEntityMaps } =
computeTwentyStandardApplicationAllFlatEntityMaps({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
});
const isDraftFlatFieldMetadata =
findFlatEntityByUniversalIdentifier<FlatFieldMetadata>({
flatEntityMaps: standardAllFlatEntityMaps.flatFieldMetadataMaps,
universalIdentifier: MESSAGE_IS_DRAFT_FIELD_UNIVERSAL_IDENTIFIER,
});
if (!isDefined(isDraftFlatFieldMetadata)) {
throw new Error(
'Standard application is missing the Message isDraft field metadata',
);
}
if (isDryRun) {
this.logger.log(
`[DRY RUN] Would create Message isDraft field for workspace ${workspaceId}`,
);
return;
}
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
{
isSystemBuild: true,
allFlatEntityOperationByMetadataName: {
fieldMetadata: {View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Confirm the deployed image's standard application seed includes MESSAGE_IS_DRAFT_FIELD_UNIVERSAL_IDENTIFIER; grep the seed source for it.
- Rebuild and redeploy the image from a commit that contains both the command and its seed definition.
- Verify the standard application is being loaded correctly (check the load logs for the twentyStandard application).
- Re-run the upgrade after redeployment.
Defensive patterns
Strategy: validation
Validate before calling
// Preflight: confirm the deployed image's standard seed defines the field.
const stdField = findFlatEntityByUniversalIdentifier<FlatFieldMetadata>({
flatEntityMaps: standardAllFlatEntityMaps.flatFieldMetadataMaps,
universalIdentifier: MESSAGE_IS_DRAFT_FIELD_UNIVERSAL_IDENTIFIER,
});
if (!isDefined(stdField)) {
throw new Error('Image standard seed lacks Message.isDraft field; rebuild and redeploy.');
} Type guard
import { isDefined } from '@twenty/shared';
type FlatFieldMetadata = { id: string; universalIdentifier?: string; type: string };
function hasStandardField(
maps: { byUniversalIdentifier: Record<string, unknown> },
id: string,
): boolean {
return isDefined(maps.byUniversalIdentifier[id]);
} Prevention
- Always build the image from a single commit so the command and its seed ship together.
- Add a preflight that asserts every command's referenced standard identifiers exist in the loaded seed before running upgrades.
- Never cherry-pick a command file without its seed update.
When it happens
Trigger: Running the 2.18 upgrade from an image whose standard metadata seed predates or omits the isDraft field definition, while the upgrade command (code) references it. Can also happen if standard seed loading was partial or the wrong standard application was loaded.
Common situations: Mismatched code+seed versions (e.g. cherry-picked the command file without its seed update); build that excluded the seed module; deploying only the migration without the matching standard-metadata package.
Related errors
- Standard application is missing messageCampaign field ${univ
- Standard application is missing messageCampaign view column
- Standard application is missing messageCampaign view ${CAMPA
- Standard application is missing messageList view column ${un
- Failed to update search command menu item labels for workspa
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/55b006108fe114c9.
Report an issue: GitHub.