twentyhq/twenty · error · Error
Failed to delete channel standard objects for workspace ${wo
Error message
Failed to delete channel standard objects for workspace ${workspaceId} What it means
Thrown by the 2.8 command that drops channel standard objects. It builds object/relation delete operations for the channel objects and submits them via validateBuildAndRunLegacyWorkspaceMigration; on status === 'fail' it logs the report and throws. The report identifies which channel object delete failed.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-8/2-8-workspace-command-1798000050000-drop-channel-standard-objects.command.ts:110
allFlatEntityOperationByMetadataName: {
objectMetadata: {
flatEntityToCreate: [],
flatEntityToDelete: objectsToDelete,
flatEntityToUpdate: [],
},
},
workspaceId,
applicationUniversalIdentifier:
twentyStandardFlatApplication.universalIdentifier,
},
);
if (validateAndBuildResult.status === 'fail') {
this.logger.error(
`Failed to delete channel standard objects:\n${JSON.stringify(validateAndBuildResult, null, 2)}`,
);
throw new Error(
`Failed to delete channel standard objects for workspace ${workspaceId}`,
);
}
this.logger.log(
`Deleted ${objectsToDelete.length} channel standard objects for workspace ${workspaceId}`,
);
}
}
View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Read the logged JSON report to find the blocking dependency.
- Remove or reassign the dependent relation/view/field rows referencing channel objects.
- Re-run the 2.8 command; if the objects are already gone, mark the workspace handled.
Defensive patterns
Strategy: validation
Validate before calling
// Confirm no live relations still reference channel objects before dropping:
const refs = Object.values(flatRelationMetadataMaps.byId).filter(r => CHANNEL_OBJECT_UIS.includes(r.fromObjectMetadataUniversalIdentifier) || CHANNEL_OBJECT_UIS.includes(r.toObjectMetadataUniversalIdentifier));
if (refs.length > 0) { /* drop or reassign them first */ } Try / catch
try {
await command.runOnWorkspace({ workspaceId, options });
} catch (e) {
logger.error({ workspaceId, err: e.message }, 'channel objects drop failed');
} Prevention
- Remove dependent relations/views on channel objects before their drop command.
- On partial failure, clear orphaned rows before retrying.
When it happens
Trigger: A channel object is referenced by a relation or view on another object that blocks deletion; a channel object was already removed in a prior run; custom fields/relations on the channel objects prevent the drop.
Common situations: Prior interrupted 2.8 run; message/participant objects still hold relations to channel; cross-version upgrade skipping dependent-relation cleanup.
Related errors
- Failed to delete connectedAccount standard object for worksp
- Failed to seed object openRecordIn for workspace ${workspace
- Failed to add NOT_RECORDED to CallRecording status metadata
- Failed to backfill standard skills for workspace ${workspace
- Failed to create the workspaceMember openRecordIn field for
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/d09557c85a193b88.
Report an issue: GitHub.