{"record":{"id":"b39daa2f640aeeb1","repo":"calcom/cal.diy","slug":"booking-with-uid-bookinguid-not-found-b39daa","errorCode":null,"errorMessage":"Booking with uid=${bookingUid} not found","messagePattern":"Booking with uid=(.+?) not found","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/booking-location.service.ts","lineNumber":51,"sourceCode":"    private readonly bookingsRepository: BookingsRepository_2024_08_13,\n    private readonly bookingsService: BookingsService_2024_08_13,\n    private readonly usersRepository: UsersRepository,\n    private readonly inputService: InputBookingsService_2024_08_13,\n    private readonly eventTypesRepository: EventTypesRepository_2024_06_14,\n    private readonly eventTypeAccessService: EventTypeAccessService,\n    private readonly bookingVideoService: BookingVideoService_2024_08_13,\n    private readonly integrationService: BookingLocationIntegrationService_2024_08_13,\n    private readonly calendarSyncService: BookingLocationCalendarSyncService_2024_08_13\n  ) {}\n\n  async updateBookingLocation(\n    bookingUid: string,\n    input: UpdateBookingLocationInput_2024_08_13,\n    user: ApiAuthGuardUser\n  ): Promise<BookingLocationResponse> {\n    const existingBooking = await this.bookingsRepository.getBookingByUidWithUserAndEventDetails(bookingUid);\n    if (!existingBooking) {\n      throw new NotFoundException(`Booking with uid=${bookingUid} not found`);\n    }\n\n    if (existingBooking.eventTypeId && existingBooking.eventType) {\n      const eventType = await this.eventTypesRepository.getEventTypeByIdWithOwnerAndTeam(\n        existingBooking.eventTypeId\n      );\n      if (eventType) {\n        const isAllowed = await this.eventTypeAccessService.userIsEventTypeAdminOrOwner(user, eventType);\n        if (!isAllowed) {\n          throw new ForbiddenException(\n            \"User is not authorized to update this booking location. User must be the event type owner, host, team admin or owner, or org admin or owner.\"\n          );\n        }\n      }\n    }\n\n    const { location } = input;\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/booking-location.service.ts#L33-L69","documentation":"Top-level guard in BookingLocationService.updateBookingLocation. The booking UID supplied to the PATCH location endpoint does not resolve via getBookingByUidWithUserAndEventDetails — the row does not exist. This is a straightforward HTTP 404 at the entry point of the location update flow.","triggerScenarios":"PATCH /v2/bookings/{uid} (or 2024-08-13 location endpoint) with a UID that no booking row matches.","commonSituations":"Typo or truncation in the UID; using a staging UID against production (or vice versa); booking already cancelled/deleted; copy/paste of a recurring-series parent UID instead of an individual booking UID.","solutions":["Verify the UID with GET /v2/bookings/{uid} before PATCHing.","Confirm you are targeting the correct environment (same DB the UID was issued from).","If the booking was deleted/cancelled, obtain the correct active booking UID."],"exampleFix":"// before: PATCH /v2/bookings/abc...notreal/location\n// after\nconst exists = await api.get(`/v2/bookings/${uid}`).catch(() => null);\nif (!exists) throw new Error(`Booking ${uid} does not exist in this environment`);\nawait api.patch(`/v2/bookings/${uid}/location`, payload);","handlingStrategy":"validation","validationCode":"// Confirm the booking exists before PATCHing its location.\nconst booking = await api.get(`/v2/bookings/${uid}`).catch((e) => (e.status === 404 ? null : Promise.reject(e)));\nif (!booking) throw new Error(`Booking ${uid} not found in this environment`);","typeGuard":"function isExistingUid(uid: string): boolean {\n  return typeof uid === 'string' && uid.trim().length > 0;\n}","tryCatchPattern":"try {\n  await api.patch(`/v2/bookings/${uid}/location`, payload);\n} catch (err) {\n  if (err.status === 404) {\n    // booking missing: verify environment / UID, or skip\n  }\n  throw err;\n}","preventionTips":["Always GET the booking before PATCHing it.","Keep UIDs sourced from the same environment you mutate.","Distinguish booking UIDs from numeric IDs and reference UIDs."],"tags":["booking","not-found","location"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}