calcom/cal.diy · error · NotFoundException
No user found for booking with uid=
Error message
No user found for booking with uid=${bookingUid} What it means
Thrown early in updateLocation when existingBooking.userId is falsy. The booking row exists but has no owner user assigned, and the location update flow (especially the integration branch) needs a host user. Distinct from error 270 which fires when userId is set but the user record is missing.
Solutions
- Set booking.userId to a valid user before attempting the location update.
- Avoid PATCHing location on bookings that lack an owner; recreate them through the normal flow.
- Backfill null userIds in the database for affected bookings.
Defensive patterns
Strategy: type-guard
Validate before calling
// Before PATCHing location, confirm the booking has an owner userId.
const booking = await api.get(`/v2/bookings/${uid}`);
if (!booking.userId) throw new Error(`Booking ${uid} has no owner user; cannot update location`); Type guard
function bookingHasOwnerId(b: { userId: number | null } | null | undefined): b is { userId: number } {
return !!b && typeof b.userId === 'number' && b.userId > 0;
} Try / catch
try {
await api.patch(`/v2/bookings/${uid}/location`, payload);
} catch (err) {
if (err.status === 404 && /No user found/.test(err.message)) {
// booking is orphaned (userId null): reassign owner or skip
}
throw err;
} Prevention
- Never create bookings without an owner user.
- Backfill null userIds in migrations.
- Guard the PATCH path by checking booking.userId before calling.
When it happens
Trigger: PATCH booking location on a booking whose userId column is null. The earlier UID lookup succeeded (so error 266 didn't fire), but this booking was never assigned an owner.
Common situations: Legacy/migrated bookings with null userId; bookings created by system/anonymous flows; data corruption where userId was cleared.
Related errors
- No event type found for booking with uid=
- No user found for booking with uid=
- ApiAuthStrategy - access token - User associated with the…
- Booking with uid= not found
- Booking with uid not found
AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12).
Data as JSON: /api/errors/cd80e1dd14a6d320.
Report an issue: GitHub.
Appendix: source
Thrown at apps/api/v2/src/platform/bookings/2024-08-13/services/booking-location.service.ts:92
await this.calendarSyncService.syncCalendarEvent(existingBooking.id, locationValue);
}
}
return await this.updateLocation(existingBooking, location, user);
}
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,
existingBookingHostView on GitHub (pinned to 176037d0af)