toeverything/AFFiNE · error · GraphqlBadRequest

caldav_host_blocked

caldav_host_blocked

Error message

CalDAV host is not allowed.

What it means

The CalDAV provider validates the user-supplied server URL against the configured allow-list of hosts and throws caldav_host_blocked GraphqlBadRequest when the hostname is not permitted, an SSRF/safety guard.

Source

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

      });
    }

    if (
      url.protocol !== 'https:' &&
      !(url.protocol === 'http:' && this.allowInsecureHttp)
    ) {
      throw new GraphqlBadRequest({
        code: 'caldav_insecure_url',
        message: 'CalDAV URL must use https.',
      });
    }

    const hostname = url.hostname.toLowerCase();
    if (
      this.allowedHosts.length &&
      !isAllowedHost(hostname, this.allowedHosts)
    ) {
      throw new GraphqlBadRequest({
        code: 'caldav_host_blocked',
        message: 'CalDAV host is not allowed.',
      });
    }
  }

  private toGraphqlSsrfError(error: unknown) {
    if (!(error instanceof SsrfBlockedError)) {
      return null;
    }

    const reason = String(error.data?.reason ?? '');

    if (reason === 'blocked_ip') {
      return new GraphqlBadRequest({
        code: 'caldav_private_network',
        message: 'CalDAV host is in a private network.',
      });

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Only connect to CalDAV hosts on the allowed-host list; remove the blocked host or add it to the server allowlist configuration.
  2. If you are the server administrator, update the CalDAV allowed hosts setting to include this domain, then retry.
  3. Use https and a public, non-private-network host; loopback and internal IPs are typically disallowed.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/backend/server/src/plugins/calendar/providers/caldav.ts:584 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/a13ae85042faeede. Report an issue: GitHub.