calcom/cal.diy · warning · BadRequestException

Google Meet is already connected for this team.

Error message

Google Meet is already connected for this team.

What it means

Thrown by GoogleMeetService.connectGoogleMeetToTeam when a Google Meet conferencing app credential already exists for the given teamId. The service first validates a Google Calendar connection exists, then queries credentialsRepository.findCredentialByTypeAndTeamId for GOOGLE_MEET_TYPE and rejects duplicates via a NestJS BadRequestException (HTTP 400). This prevents a team from accumulating multiple Google Meet credentials.

Source

Thrown at apps/api/v2/src/modules/conferencing/services/google-meet.service.ts:36

    await this.validateGoogleCalendarConnection(userId, "user");

    const googleMeetExists = await this.conferencingRepository.findGoogleMeet(userId);
    if (googleMeetExists) {
      throw new BadRequestException("Google Meet is already connected for this user.");
    }

    return this.credentialsRepository.upsertUserAppCredential(GOOGLE_MEET_TYPE, {}, userId);
  }

  async connectGoogleMeetToTeam(teamId: number) {
    await this.validateGoogleCalendarConnection(teamId, "team");

    const googleMeetExists = await this.credentialsRepository.findCredentialByTypeAndTeamId(
      GOOGLE_MEET_TYPE,
      teamId
    );
    if (googleMeetExists) {
      throw new BadRequestException("Google Meet is already connected for this team.");
    }

    return this.credentialsRepository.upsertTeamAppCredential(GOOGLE_MEET_TYPE, {}, teamId);
  }

  /**
   * Validate that Google Calendar is connected and valid for either a user or a team.
   */
  private async validateGoogleCalendarConnection(id: number, entity: "user" | "team") {
    const googleCalendar =
      entity === "user"
        ? await this.credentialsRepository.findCredentialByTypeAndUserId(GOOGLE_CALENDAR_TYPE, id)
        : await this.credentialsRepository.findCredentialByTypeAndTeamId(GOOGLE_CALENDAR_TYPE, id);

    if (!googleCalendar) {
      throw new BadRequestException("Google Meet requires a Google Calendar connection.");
    }

View on GitHub (pinned to 176037d0af)

Solutions

  1. Check the team's existing Google Meet credential before calling connect (GET the conferencing status endpoint) and skip if already present.
  2. Disconnect (delete the existing GOOGLE_MEET_TYPE credential for the team) first, then reconnect.
  3. Treat HTTP 400 with this message as success-equivalent in the client if the goal is just 'ensure connected'.

Example fix

// before
await api.connectGoogleMeetToTeam(teamId);

// after
const existing = await api.getTeamConferencing(teamId);
if (!existing.googleMeet) {
  await api.connectGoogleMeetToTeam(teamId);
}
Defensive patterns

Strategy: validation

Validate before calling

const existing = await credentialsRepository.findCredentialByTypeAndTeamId(GOOGLE_MEET_TYPE, teamId);
if (existing) {
  // already connected; skip or return the existing credential
  return existing;
}
await googleMeetService.connectGoogleMeetToTeam(teamId);

Try / catch

try {
  await googleMeetService.connectGoogleMeetToTeam(teamId);
} catch (e) {
  if (e instanceof BadRequestException && e.message.includes('already connected')) {
    // idempotent success
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: POST/PUT to the v2 conferencing connect endpoint for a team that already has a stored GOOGLE_MEET_TYPE credential. Happens on retry of a connection call, double-submit of a connect form, or an idempotency check before the upsert at the end of connectGoogleMeetToTeam.

Common situations: User clicks 'Connect Google Meet' twice; a frontend retry fires after a partial success; a previous team admin already connected it and a second admin tries again; a migration/seed left an orphan credential.

Related errors


AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12). Data as JSON: /api/errors/4cba642ac14a0a72. Report an issue: GitHub.