{"record":{"id":"ce960effd1ab9dbb","repo":"twentyhq/twenty","slug":"failed-to-seed-object-openrecordin-for-workspace","errorCode":null,"errorMessage":"Failed to seed object openRecordIn for workspace ${workspaceId}","messagePattern":"Failed to seed object openRecordIn 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-1785505100000-seed-object-open-record-in.command.ts","lineNumber":188,"sourceCode":"          applicationUniversalIdentifier:\n            twentyStandardFlatApplication.universalIdentifier,\n          workspaceId,\n          allFlatEntityOperationByMetadataName: {\n            objectMetadata: {\n              flatEntityToCreate: [],\n              flatEntityToDelete: [],\n              flatEntityToUpdate: objectMetadatasToUpdate,\n            },\n          },\n        },\n      );\n\n    if (result.status === 'fail') {\n      this.logger.error(\n        `Failed to seed object openRecordIn:\\n${JSON.stringify(result, null, 2)}`,\n      );\n\n      throw new Error(\n        `Failed to seed object openRecordIn for workspace ${workspaceId}`,\n      );\n    }\n\n    this.logger.log(`Seeded object openRecordIn for workspace ${workspaceId}`);\n  }\n}\n","sourceCodeStart":170,"sourceCodeEnd":196,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-27/2-27-workspace-command-1785505100000-seed-object-open-record-in.command.ts#L170-L196","documentation":"Thrown by the 2.27 command that seeds the object-level openRecordIn setting across objects. It collects objectMetadatasToUpdate and runs them through validateBuildAndRunLegacyWorkspaceMigration; on status === 'fail' it logs the report and throws. The report identifies which object(s) failed the update validation.","triggerScenarios":"One of the objects being updated is missing, deactivated, or has an openRecordIn value that fails the field validator; an object universalIdentifier in the update batch no longer resolves in the workspace; a custom object shares a target table name with a standard one causing a collision in the generated migration.","commonSituations":"Objects deleted/deactivated by the workspace between cache load and build; a prior migration left openRecordIn in an invalid state; custom objects whose names collide with reserved tables.","solutions":["Inspect the logged JSON report — note the failing object universalIdentifier(s) and error code.","For each flagged object, verify it still exists and is active; correct any invalid openRecordIn value already stored.","Invalidate and recompute the workspace object metadata cache, then re-run the 2.27 command."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify target objects are active before submitting the batch:\nconst active = objectMetadatasToUpdate.filter(o => !o.isCustom && o.isActive !== false);\nif (active.length !== objectMetadatasToUpdate.length) { /* investigate drift */ }","typeGuard":null,"tryCatchPattern":"try {\n  await command.runOnWorkspace({ workspaceId, options });\n} catch (e) {\n  logger.error({ workspaceId, err: e.message }, 'object openRecordIn seed failed');\n}","preventionTips":["Invalidate and recompute the object metadata cache before retrying.","Do not deactivate standard objects the seed targets; if deactivated, reactivate or skip."],"tags":["migration","upgrade-command","validate-and-build","workspace","object-metadata","open-record-in"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}