{"record":{"id":"42d274dfde5551e0","repo":"calcom/cal.diy","slug":"no-event-type-found-for-booking-with-uid-booking","errorCode":null,"errorMessage":"No event type found for booking with uid=${bookingUid}","messagePattern":"No event type found for booking with uid=(.+?)","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/booking-location.service.ts","lineNumber":96,"sourceCode":"    }\n\n    return this.bookingsService.getBooking(existingBooking.uid, user);\n  }\n\n  private async updateLocation(\n    existingBooking: BookingForLocationUpdate,\n    inputLocation: UpdateBookingInputLocation_2024_08_13,\n    user: ApiAuthGuardUser\n  ): Promise<BookingLocationResponse> {\n    const bookingUid = existingBooking.uid;\n    const oldLocation = existingBooking.location;\n\n    if (!existingBooking.userId) {\n      throw new NotFoundException(`No user found for booking with uid=${bookingUid}`);\n    }\n\n    if (!existingBooking.eventTypeId) {\n      throw new NotFoundException(`No event type found for booking with uid=${bookingUid}`);\n    }\n\n    const existingBookingHost = await this.usersRepository.findById(existingBooking.userId);\n\n    if (!existingBookingHost) {\n      throw new NotFoundException(`No user found for booking with uid=${bookingUid}`);\n    }\n\n    if (inputLocation.type === \"integration\") {\n      return this.integrationService.handleIntegrationLocationUpdate(\n        existingBooking,\n        inputLocation,\n        user,\n        existingBookingHost\n      );\n    }\n\n    const bookingLocation = this.getNonIntegrationLocationValue(inputLocation);","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/booking-location.service.ts#L78-L114","documentation":"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.","triggerScenarios":"PATCH booking location on a booking whose eventTypeId column is null — i.e., a booking not created from an event type.","commonSituations":"Ad-hoc/legacy bookings created outside the event-type flow; bookings from older API versions; data migration that dropped eventTypeId.","solutions":["Ensure the booking was created from an event type and has eventTypeId set.","Backfill eventTypeId where determinable, or recreate the booking via POST /v2/bookings with an eventTypeId.","Do not attempt location updates on event-type-less bookings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before PATCHing location, confirm the booking has an event type.\nconst booking = await api.get(`/v2/bookings/${uid}`);\nif (!booking.eventTypeId) throw new Error(`Booking ${uid} has no event type; cannot update location`);","typeGuard":"function bookingHasEventTypeId(b: { eventTypeId: number | null } | null | undefined): b is { eventTypeId: number } {\n  return !!b && typeof b.eventTypeId === 'number' && b.eventTypeId > 0;\n}","tryCatchPattern":"try {\n  await api.patch(`/v2/bookings/${uid}/location`, payload);\n} catch (err) {\n  if (err.status === 404 && /No event type found/.test(err.message)) {\n    // booking is event-type-less; recreate via POST /v2/bookings with an eventTypeId\n  }\n  throw err;\n}","preventionTips":["Only create bookings tied to an event type.","Avoid location updates on legacy/ad-hoc bookings without eventTypeId.","Pre-check booking.eventTypeId before PATCHing."],"tags":["booking","event-type","data-integrity","location"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}