twentyhq/twenty · error · Error

Failed to add the CalendarEvent Call Recording tab for works

Error message

Failed to add the CalendarEvent Call Recording tab for workspace ${workspaceId}: ${JSON.stringify(validateAndBuildResult, null, 2)}

What it means

Thrown by the 2.31 command that adds the CalendarEvent Call Recording tab. It creates page-layout widgets/tabs via validateBuildAndRunLegacyWorkspaceMigration; on status === 'fail' it throws with the full report embedded. The report shows which page-layout-widget/tab failed validation.

Source

Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-31/2-31-workspace-command-1786437483000-add-calendar-event-call-recording-tab.command.ts:157

            twentyStandardFlatApplication.universalIdentifier,
          workspaceId,
          allFlatEntityOperationByMetadataName: {
            pageLayoutTab: {
              flatEntityToCreate: pageLayoutTabsToCreate,
              flatEntityToDelete: [],
              flatEntityToUpdate: [],
            },
            pageLayoutWidget: {
              flatEntityToCreate: pageLayoutWidgetsToCreate,
              flatEntityToDelete: [],
              flatEntityToUpdate: [],
            },
          },
        },
      );

    if (validateAndBuildResult.status === 'fail') {
      throw new Error(
        `Failed to add the CalendarEvent Call Recording tab for workspace ${workspaceId}: ${JSON.stringify(
          validateAndBuildResult,
          null,
          2,
        )}`,
      );
    }

    this.logger.log(
      `Added the CalendarEvent Call Recording tab for workspace ${workspaceId}`,
    );
  }
}

View on GitHub (pinned to 1f5dd2bbd2)

Solutions

  1. Parse the JSON report to find the failing widget/tab and error code.
  2. Ensure the CalendarEvent record page layout and the Call Recording object exist for the workspace.
  3. Clear any partially-created tab/widget rows for that workspace, then re-run the 2.31 command.
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the CalendarEvent record page layout and Call Recording object exist:
const layout = flatPageLayoutMaps.byUniversalIdentifier[CALENDAR_EVENT_RECORD_PAGE_UI];
const callRecording = flatObjectMetadataMaps.byUniversalIdentifier[CALL_RECORDING_UI];
if (!isDefined(layout) || !isDefined(callRecording)) { /* seed missing pieces first */ }

Try / catch

try {
  await command.runOnWorkspace({ workspaceId, options });
} catch (e) {
  const report = JSON.parse(e.message.split(':').slice(1).join(':').trim());
  logger.error({ workspaceId, report }, 'Call Recording tab add failed');
}

Prevention

When it happens

Trigger: The CalendarEvent record page layout the tab attaches to is missing or was customised away; the Call Recording object/relation referenced by the tab widget does not exist in the workspace; a tab with the same universalIdentifier already exists (collision the idempotency check missed); the widget configuration references an absent view.

Common situations: Workspace where the CalendarEvent record page was replaced by a custom layout; Call Recording standard object not yet seeded (skipped earlier command); partial prior run that created the tab metadata but not its widgets.

Related errors


AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12). Data as JSON: /api/errors/0a61cad88efe0537. Report an issue: GitHub.