{"record":{"id":"06e7b3cc7ca282db","repo":"calcom/cal.diy","slug":"failed-to-add-guests-to-the-booking","errorCode":null,"errorMessage":"Failed to add guests to the booking","messagePattern":"Failed to add guests to the booking","errorType":"http","errorClass":"HttpException","httpStatus":500,"severity":"error","filePath":"apps/api/v2/src/platform/bookings/2024-08-13/services/booking-guests.service.ts","lineNumber":55,"sourceCode":"      );\n    }\n\n    const platformClientParams = booking.eventTypeId\n      ? await this.platformBookingsService.getOAuthClientParams(booking.eventTypeId)\n      : undefined;\n\n    const emailsEnabled = platformClientParams ? platformClientParams.arePlatformEmailsEnabled : true;\n\n    const res = await addGuestsHandler({\n      ctx: { user },\n      input: { bookingId: booking.id, guests: input.guests },\n      emailsEnabled,\n      actionSource: \"API_V2\",\n    });\n    if (res.message === \"Guests added\") {\n      return await this.bookingsService.getBooking(bookingUid, user);\n    } else {\n      throw new HttpException(\n        \"Failed to add guests to the booking\",\n        500\n      );\n    }\n  }\n}\n","sourceCodeStart":37,"sourceCodeEnd":62,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/platform/bookings/2024-08-13/services/booking-guests.service.ts#L37-L62","documentation":"A 500 HttpException thrown by BookingGuestsService_2024_08_13.addGuests when the addGuestsHandler returns successfully but its response message is not the expected 'Guests added' string. This indicates the handler completed without throwing but didn't perform the expected operation — an unexpected internal state.","triggerScenarios":"POST /v2/bookings/{bookingUid}/guests where addGuestsHandler (from @calcom/platform-libraries/bookings) resolves without throwing but returns a response object whose .message field is something other than 'Guests added'. This could be a partial success, a silent failure, or a version mismatch in the handler's response contract.","commonSituations":"The addGuestsHandler internally encounters an issue (e.g., email delivery disabled, attendee already exists) and returns a different message instead of throwing. A library version mismatch where the handler's response message format changed. An edge case in the handler logic where the booking is in a transitional state.","solutions":["Check server logs — addGuestsHandler may log the specific reason it didn't return 'Guests added'.","Verify the booking is in a state that supports guest addition (ACCEPTED or PENDING, not CANCELLED).","Check if any of the guest emails are already registered as attendees — duplicates may cause a non-success message.","If using platform OAuth client settings, verify arePlatformEmailsEnabled and related settings aren't causing a silent rejection.","Report to Cal.com if the handler returns an unexpected message with no logged explanation — this may be a bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await api.addGuests(bookingUid, guests);\n} catch (err) {\n  if (err.statusCode === 500 && err.message === 'Failed to add guests to the booking') {\n    // Unexpected internal state — check server logs and retry once\n    console.error('Guest addition returned unexpected state for booking', bookingUid);\n    await api.addGuests(bookingUid, guests); // single retry\n  } else { throw err; }\n}","preventionTips":["Verify the booking is in an active state (ACCEPTED/PENDING) before adding guests.","Check for duplicate guest emails — duplicates may cause a non-success handler response.","If using OAuth client settings, verify arePlatformEmailsEnabled is configured correctly.","Log the full request payload when this error occurs to help diagnose the handler's unexpected response."],"tags":["internal-server-error","booking","guests","unexpected-state","nestjs"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}