calcom/cal.diy · critical · NotFoundException

Office365 app not found

Error message

Office365 app not found

What it means

Thrown by Office365VideoService.getOffice365AppKeys when the Office365 video app's keys, parsed through zoomAppKeysSchema, yield a falsy client_id. The app is loaded via appsRepository.getAppBySlug(OFFICE_365_VIDEO); if its keys lack a client_id the service throws NotFoundException (HTTP 404). This is a server configuration error, not a per-user error.

Source

Thrown at apps/api/v2/src/modules/conferencing/services/office365-video.service.ts:37

@Injectable()
export class Office365VideoService {
  private logger = new Logger("Office365VideoService");
  private redirectUri = `${this.config.get("api.url")}/conferencing/${OFFICE_365_VIDEO}/oauth/callback`;
  private scopes = ["OnlineMeetings.ReadWrite", "offline_access"];

  constructor(
    private readonly config: ConfigService,
    private readonly appsRepository: AppsRepository,
    private readonly credentialsRepository: CredentialsRepository
  ) {}

  async getOffice365AppKeys() {
    const app = await this.appsRepository.getAppBySlug(OFFICE_365_VIDEO);

    const { client_id, client_secret } = zoomAppKeysSchema.parse(app?.keys);

    if (!client_id) {
      throw new NotFoundException("Office365 app not found");
    }

    if (!client_secret) {
      throw new NotFoundException("Office365 app not found");
    }

    return { client_id, client_secret };
  }

  async generateOffice365AuthUrl(state: string) {
    const { client_id } = await this.getOffice365AppKeys();

    const params = {
      response_type: "code",
      client_id,
      scope: this.scopes.join(" "),
      redirect_uri: this.redirectUri,
      state: state,

View on GitHub (pinned to 176037d0af)

Solutions

  1. Open the admin App Store, find the Office365 video app, and set a valid client_id (Azure AD application ID).
  2. Verify the app slug stored matches OFFICE_365_VIDEO constant exactly so getAppBySlug returns the right row.
  3. Confirm the keys JSON shape matches zoomAppKeysSchema (requires client_id and client_secret).
Defensive patterns

Strategy: validation

Validate before calling

const app = await appsRepository.getAppBySlug(OFFICE_365_VIDEO);
const keys = zoomAppKeysSchema.safeParse(app?.keys);
if (!keys.success || !keys.data.client_id) {
  throw new Error('Office365 app misconfigured: missing client_id. Configure it in the App Store.');
}

Type guard

const hasClientId = (k: unknown): k is { client_id: string; client_secret: string } =>
  typeof k === 'object' && k !== null && typeof (k as any).client_id === 'string' && !!(k as any).client_id;

Prevention

When it happens

Trigger: Any call that reaches getOffice365AppKeys (generateOffice365AuthUrl, connectOffice365App) when the Office365 app row in the database has empty/missing client_id in its keys JSON. The `if (!client_id)` branch fires.

Common situations: The Office365 conferencing app was never configured in the admin App Store; the app row exists but client_id/client_secret fields were left blank; env-staging missing the keys present in production; a re-import of app data dropped the keys.

Related errors


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