{"record":{"id":"4f3943ef879cec4a","repo":"calcom/cal.diy","slug":"no-calendar-id-provided-in-createattendees","errorCode":null,"errorMessage":"no calendar id provided in createAttendees","messagePattern":"no calendar id provided in createAttendees","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-store/feishucalendar/lib/CalendarService.ts","lineNumber":184,"sourceCode":"        url: \"\",\n        additionalInfo: {},\n      };\n    } catch (error) {\n      this.log.error(error);\n      await this.deleteEvent(eventId, event, calendarId);\n      throw error;\n    }\n  }\n\n  private createAttendees = async (event: CalendarEvent, eventId: string, credentialId: number) => {\n    const mainHostDestinationCalendar = event.destinationCalendar\n      ? event.destinationCalendar.find((cal) => cal.credentialId === credentialId) ??\n        event.destinationCalendar[0]\n      : undefined;\n    const calendarId = mainHostDestinationCalendar?.externalId;\n    if (!calendarId) {\n      this.log.error(\"no calendar id provided in createAttendees\");\n      throw new Error(\"no calendar id provided in createAttendees\");\n    }\n    const attendeeResponse = await this.fetcher(\n      `/calendar/v4/calendars/${calendarId}/events/${eventId}/attendees/create_attendees`,\n      {\n        method: \"POST\",\n        body: JSON.stringify({\n          attendees: this.translateAttendees(event),\n          need_notification: false,\n        }),\n      }\n    );\n\n    return handleFeishuError<CreateAttendeesResp>(attendeeResponse, this.log);\n  };\n\n  /**\n   * @param uid\n   * @param event","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/packages/app-store/feishucalendar/lib/CalendarService.ts#L166-L202","documentation":"Thrown by FeishuCalendarService.createAttendees (a private method called by createEvent after the event is created) when calendarId cannot be resolved from the destinationCalendar matching credentialId. Identical root cause to error 556, but reached after event creation — meaning a partially-created Feishu event will exist (createEvent catches this and calls deleteEvent to roll back).","triggerScenarios":"Event created successfully, then createAttendees is invoked with a credentialId that matches no destinationCalendar entry, or destinationCalendar is undefined/empty. createEvent's catch block will then delete the just-created event.","commonSituations":"destinationCalendar list mutated between createEvent and createAttendees (rare); credentialId mismatch; destinationCalendar.externalId empty; race condition where destinationCalendar is being updated concurrently.","solutions":["Resolve createEvent's calendarId once and pass it into createAttendees instead of re-deriving (avoids divergence).","Ensure destinationCalendar rows for all host credentials are populated before booking.","Verify the rollback (deleteEvent) actually fires and cleans the orphan event — check logs.","Surface the original error message (this.log.error already logs it) so the operator can see which credentialId failed."],"exampleFix":"// before - re-derive calendarId, can diverge from createEvent\nprivate createAttendees = async (event, eventId, credentialId) => {\n  const mainHostDestinationCalendar = event.destinationCalendar?.find(c => c.credentialId === credentialId) ?? ...;\n  const calendarId = mainHostDestinationCalendar?.externalId;\n  if (!calendarId) throw new Error(\"no calendar id provided in createAttendees\");\n  ...\n};\n\n// after - accept the validated calendarId from createEvent\nprivate createAttendees = async (event, eventId, calendarId: string) => {\n  // calendarId already validated by caller\n  const attendeeResponse = await this.fetcher(`/calendar/v4/calendars/${calendarId}/events/${eventId}/attendees/create_attendees`, ...);\n};","handlingStrategy":"validation","validationCode":"if (!calendarId) throw new Error(\"calendarId required for createAttendees\");\n// Pass the validated calendarId from createEvent into createAttendees.","typeGuard":"const hasCalendarId = (id: unknown): id is string => typeof id === \"string\" && id.length > 0;","tryCatchPattern":"if (!calendarId) {\n  this.log.error(\"no calendar id provided in createAttendees\", { credentialId });\n  throw new Error(`Cannot create attendees: no calendar id for credential ${credentialId}`);\n}","preventionTips":["Pass createEvent's validated calendarId into createAttendees to avoid re-derivation.","Verify destinationCalendar rows exist for every host credential before booking.","Confirm createEvent's rollback (deleteEvent) actually runs on this failure."],"tags":["feishu","larksuite","calendar","attendees","destination-calendar","validation"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}