calcom/cal.diy · error · NotFoundException

No event type found for booking with uid=${bookingUid}

Error message

No event type found for booking with uid=${bookingUid}

What it means

Thrown in updateLocation when existingBooking.eventTypeId is falsy. The location update flow expects the booking to be tied to an event type (used for calendar sync, notifications, and metadata). A booking without an event type cannot proceed.

Source

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

    }

    return this.bookingsService.getBooking(existingBooking.uid, user);
  }

  private async updateLocation(
    existingBooking: BookingForLocationUpdate,
    inputLocation: UpdateBookingInputLocation_2024_08_13,
    user: ApiAuthGuardUser
  ): Promise<BookingLocationResponse> {
    const bookingUid = existingBooking.uid;
    const oldLocation = existingBooking.location;

    if (!existingBooking.userId) {
      throw new NotFoundException(`No user found for booking with uid=${bookingUid}`);
    }

    if (!existingBooking.eventTypeId) {
      throw new NotFoundException(`No event type found for booking with uid=${bookingUid}`);
    }

    const existingBookingHost = await this.usersRepository.findById(existingBooking.userId);

    if (!existingBookingHost) {
      throw new NotFoundException(`No user found for booking with uid=${bookingUid}`);
    }

    if (inputLocation.type === "integration") {
      return this.integrationService.handleIntegrationLocationUpdate(
        existingBooking,
        inputLocation,
        user,
        existingBookingHost
      );
    }

    const bookingLocation = this.getNonIntegrationLocationValue(inputLocation);

View on GitHub (pinned to 176037d0af)

Solutions

  1. Ensure the booking was created from an event type and has eventTypeId set.
  2. Backfill eventTypeId where determinable, or recreate the booking via POST /v2/bookings with an eventTypeId.
  3. Do not attempt location updates on event-type-less bookings.
Defensive patterns

Strategy: validation

Validate before calling

// Before PATCHing location, confirm the booking has an event type.
const booking = await api.get(`/v2/bookings/${uid}`);
if (!booking.eventTypeId) throw new Error(`Booking ${uid} has no event type; cannot update location`);

Type guard

function bookingHasEventTypeId(b: { eventTypeId: number | null } | null | undefined): b is { eventTypeId: number } {
  return !!b && typeof b.eventTypeId === 'number' && b.eventTypeId > 0;
}

Try / catch

try {
  await api.patch(`/v2/bookings/${uid}/location`, payload);
} catch (err) {
  if (err.status === 404 && /No event type found/.test(err.message)) {
    // booking is event-type-less; recreate via POST /v2/bookings with an eventTypeId
  }
  throw err;
}

Prevention

When it happens

Trigger: PATCH booking location on a booking whose eventTypeId column is null — i.e., a booking not created from an event type.

Common situations: Ad-hoc/legacy bookings created outside the event-type flow; bookings from older API versions; data migration that dropped eventTypeId.

Related errors


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