toeverything/AFFiNE · error · GraphqlBadRequest

caldav_account_missing

caldav_account_missing

Error message

CalDAV account metadata is missing.

What it means

listCalendars requires the stored account to carry a calendarHomeUrl; when params.account is missing it or the provider cannot proceed, it throws caldav_account_missing, indicating incomplete/partial account metadata from a prior connection.

Source

Thrown at packages/backend/server/src/plugins/calendar/providers/caldav.ts:881

      discoveryUrl
    );
    const providerAccountId =
      principalUrl || `${params.username}@${new URL(discoveryUrl).hostname}`;

    return {
      providerAccountId,
      serverUrl: discoveryUrl,
      principalUrl,
      calendarHomeUrl,
      authType: client.authType === 'auto' ? null : client.authType,
    };
  }

  override async listCalendars(
    params: CalendarProviderListCalendarsParams
  ): Promise<CalendarProviderCalendar[]> {
    if (!params.account?.calendarHomeUrl) {
      throw new GraphqlBadRequest({
        code: 'caldav_account_missing',
        message: 'CalDAV account metadata is missing.',
      });
    }

    const policy = new CalDAVRequestPolicy({
      calendar: { caldav: this.config },
    });
    const client = new CalDAVClient(
      policy,
      {
        username: params.account.username ?? params.account.email ?? '',
        password: params.accessToken,
      },
      (params.account.authType as CalendarCalDAVAuthType) ?? 'auto'
    );

    const url = resolveHref(

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Reconnect the CalDAV account so the server stores fresh account metadata.
  2. Delete the stale calendar integration entry and add the CalDAV account again.
  3. Check server logs for a failed earlier sync that left the account record incomplete.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/backend/server/src/plugins/calendar/providers/caldav.ts:881 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/e4370a0190713305. Report an issue: GitHub.