calcom/cal.diy · error · NotFoundException

Booking with seatUid=${seatUid} was not found in the databas

Error message

Booking with seatUid=${seatUid} was not found in the database

What it means

Thrown by getBookingBySeatUid when the booking seat lookup (bookingSeatRepository.getByReferenceUidIncludeBookingWithAttendeesAndUserAndEvent) returns null or returns a seat with no associated booking. Maps to NotFoundException (HTTP 404).

Source

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

      throw new NotFoundException(`Booking with uid=${uid} was not found in the database`);
    }
    const ids = recurringBooking.map((booking) => booking.id);
    const isRecurringSeated = !!recurringBooking[0].eventType?.seatsPerTimeSlot;
    if (isRecurringSeated) {
      const showAttendees =
        userIsEventTypeAdminOrOwner || !!recurringBooking[0].eventType?.seatsShowAttendees;
      return this.outputService.getOutputRecurringSeatedBookings(ids, showAttendees);
    }

    return this.outputService.getOutputRecurringBookings(ids);
  }

  async getBookingBySeatUid(seatUid: string, authUser: AuthOptionalUser) {
    const bookingSeat =
      await this.bookingSeatRepository.getByReferenceUidIncludeBookingWithAttendeesAndUserAndEvent(seatUid);

    if (!bookingSeat || !bookingSeat.booking) {
      throw new NotFoundException(`Booking with seatUid=${seatUid} was not found in the database`);
    }

    const booking = bookingSeat.booking;
    const userIsEventTypeAdminOrOwner =
      authUser && booking.eventType
        ? await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(
            authUser,
            booking.eventType as EventType
          )
        : false;

    const isRecurring = !!booking.recurringEventId;
    const seatsShowAttendees = !!booking.eventType?.seatsShowAttendees;
    const showAllAttendees = userIsEventTypeAdminOrOwner || seatsShowAttendees;

    // When user is not admin and seatsShowAttendees is false, show only the attendee for this seatUid
    if (!showAllAttendees) {
      const seatAttendee = booking.attendees.find(

View on GitHub (pinned to 176037d0af)

Solutions

  1. Confirm the value passed is a seatUid (returned when booking a seat), not the parent booking uid.
  2. If the seat was cancelled, it is removed — retrieve the parent booking and use a valid seat uid.
  3. List seats via the booking detail endpoint to find an active seatUid.

Example fix

// before
const res = await client.get(`/v2/bookings?seatUid=${bookingUid}`);
// after — use the seatUid from the original seated booking response
const res = await client.get(`/v2/bookings?seatUid=${seat.seatUid}`);
Defensive patterns

Strategy: validation

Validate before calling

const booking = await client.get(`/v2/bookings/${parentUid}`);
const seat = booking.seats?.find(s => s.seatUid === seatUid);
if (!seat) throw new Error('seatUid not active under booking');

Type guard

function isSeatUid(uid: string, knownSeats: string[]): boolean {
  return knownSeats.includes(uid);
}

Try / catch

try { return await client.get(`/v2/bookings?seatUid=${seatUid}`); }
catch (e) {
  if (e.status === 404 && /seatUid/.test(e.message)) { /* fetch parent, find active seat */ }
  else throw e;
}

Prevention

When it happens

Trigger: A GET request that resolves a booking by its seat UID (e.g. individual seat in a seated event) where the seatUid does not exist, was cancelled, or never created.

Common situations: Using the booking uid instead of the seat uid; seat was cancelled via cancelBooking with seatUid; seatUid from a different environment.

Related errors


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