calcom/cal.diy · error · BadRequestException

No ${requiredCalendarType.replace("_", " ")} event found for

Error message

No ${requiredCalendarType.replace("_", " ")} event found for this booking. ${ctx.integrationSlug} requires a ${requiredCalendarType.replace("_", " ")} event to generate the meeting link.

What it means

Thrown by handleCalendarBasedIntegration when the booking has no non-deleted reference whose type includes the requiredCalendarType (google_calendar for google-meet, office365_calendar for MS Teams). Calendar-based meeting-link generation works by updating the existing calendar event, so a missing calendar reference leaves nothing to attach the conference to.

Source

Thrown at apps/api/v2/src/platform/bookings/2024-08-13/services/booking-location-integration.service.ts:254

    });

    if (videoCallUrl) {
      await this.calendarSyncService.syncCalendarEvent(ctx.existingBooking.id, bookingLocation);
    }

    return this.updateBookingWithVideoLocation(ctx, videoCallUrl, bookingLocation, evt);
  }

  private async handleCalendarBasedIntegration(
    ctx: IntegrationHandlerContext,
    requiredCalendarType: string
  ): Promise<BookingLocationResponse> {
    const calendarReference = ctx.booking.references.find(
      (ref) => ref.type.includes(requiredCalendarType) && !ref.deleted
    );

    if (!calendarReference) {
      throw new BadRequestException(
        `No ${requiredCalendarType.replace("_", " ")} event found for this booking. ${ctx.integrationSlug} requires a ${requiredCalendarType.replace("_", " ")} event to generate the meeting link.`
      );
    }

    const calendarCredential = await this.credentialService.getCredentialForReference(
      calendarReference,
      ctx.booking.user?.credentials || []
    );

    if (!calendarCredential) {
      throw new BadRequestException(
        `Could not find calendar credentials for ${ctx.integrationSlug}. Please reconnect your calendar.`
      );
    }

    const evt = await this.calendarSyncService.buildCalEventFromBookingData(
      ctx.booking,
      ctx.internalLocation,

View on GitHub (pinned to 176037d0af)

Solutions

  1. Have the organizer connect the matching calendar (Google Calendar for Meet, Office365 for Teams) and re-sync the booking so a calendar reference is created.
  2. For google-meet without any Google Calendar, rely on the built-in Cal Video fallback by ensuring no google_calendar reference exists (the code auto-falls-back) — but to get a real Meet link you must connect Google Calendar.
  3. Switch to an integration that does not require a calendar event (e.g. cal-video, or the VideoApi path for Teams).
Defensive patterns

Strategy: validation

Validate before calling

// Before PATCHing to a calendar-based integration, confirm a non-deleted calendar reference exists.
const refs = await api.get(`/v2/bookings/${uid}/references`);
const required = integrationSlug === 'google-meet' ? 'google_calendar' : 'office365_calendar';
const hasCalRef = refs.some((r) => r.type.includes(required) && !r.deleted);
if (!hasCalRef) throw new Error(`No ${required} reference on booking; connect the calendar and re-sync`);

Type guard

function hasCalendarReference(refs: { type: string; deleted?: boolean }[], requiredType: string): boolean {
  return refs.some((r) => r.type.includes(requiredType) && !r.deleted);
}

Try / catch

try {
  await api.patch(`/v2/bookings/${uid}/location`, { location: { type: 'integration', integration: 'google-meet' } });
} catch (err) {
  if (err.status === 400 && /event found for this booking/.test(err.message)) {
    // ask host to connect Google Calendar + re-sync, or switch to cal-video
  }
  throw err;
}

Prevention

When it happens

Trigger: PATCH booking location to "google-meet" with an explicit Google Calendar path, or "office365-video" with an Office365 calendar, when the booking was never synced to that calendar (no reference row). Occurs when the organizer lacked the calendar connected at booking time, or the calendar event reference was marked deleted.

Common situations: Organizer connected only the video app but not the matching calendar; booking made before the calendar integration was linked; calendar event reference soft-deleted by a prior edit; google-meet path reached because the booking actually has google_calendar but it was deleted.

Related errors


AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12). Data as JSON: /api/errors/32efe5b1145e2190. Report an issue: GitHub.