monicahq/monica · error · DavServerNotCompliantException

server is not compliant with rfc2518 section 15.1, or rfc635

Error message

server is not compliant with rfc2518 section 15.1, or rfc6352 section 6.1

What it means

After an address book URL is found, checkOptions() sends an OPTIONS request and parses the DAV response header into compliance tokens. Monica requires class '1' and class '3', plus the 'addressbook' token when subscribing (RFC 2518 section 15.1 classes, RFC 6352 section 6.1 CardDAV compliance). If any token is missing from the DAV header the server is deemed not CardDAV-capable and DavServerNotCompliantException is thrown. Google endpoints (googleapis.com) are explicitly exempted from this check.

Source

Thrown at app/Domains/Contact/DavClient/Services/Utils/AddressBookGetter.php:155

        return $addressBook !== null
            ? $this->client->path($addressBook)
            : null;
    }

    /**
     * Check options of the server.
     *
     * @see https://datatracker.ietf.org/doc/html/rfc2518#section-15
     * @see https://datatracker.ietf.org/doc/html/rfc6352#section-6.1
     *
     * @throws DavServerNotCompliantException
     */
    private function checkOptions(bool $addressbook = false, string $url = ''): void
    {
        $options = $this->client->options($url);

        if (! in_array('1', $options) || ! in_array('3', $options) || ($addressbook && ! in_array('addressbook', $options))) {
            throw new DavServerNotCompliantException('server is not compliant with rfc2518 section 15.1, or rfc6352 section 6.1');
        }
    }

    /**
     * Get principal name.
     *
     * @see https://datatracker.ietf.org/doc/html/rfc5397#section-3
     *
     * @throws DavServerNotCompliantException
     */
    private function getCurrentUserPrincipal(string $uri = ''): string
    {
        $prop = $this->client->getProperty('{DAV:}current-user-principal', $uri);

        if (is_null($prop) || empty($prop)) {
            throw new DavServerNotCompliantException('Server does not support rfc 5397 section 3 (DAV:current-user-principal)');
        } elseif (is_string($prop)) {
            return $prop;

View on GitHub (pinned to e08e917341)

Solutions

  1. Check the header yourself: curl -i -X OPTIONS <addressbook-url> — the DAV header must include 1, 3 and addressbook (e.g. 'DAV: 1, 2, 3, access-control, addressbook')
  2. If a proxy sits in front, configure it to forward the DAV header (nginx: proxy_pass_header Dav; or stop dropping unknown headers)
  3. Point Monica at a real CardDAV server (Nextcloud, Baikcal/radicale/sabre-dav based stacks)
  4. Ensure no firewall or server rule blocks the OPTIONS method
Defensive patterns

Strategy: validation

Validate before calling

// Preflight: assert the server advertises CardDAV compliance in its DAV header
$response = Http::withBasicAuth($username, $password)->send('OPTIONS', $addressBookUrl);
$davHeader = (string) $response->header('DAV');
$tokens = array_map('trim', explode(',', $davHeader));

if (! in_array('1', $tokens, true) || ! in_array('3', $tokens, true) || ! in_array('addressbook', $tokens, true)) {
    throw ValidationException::withMessages([
        'base_uri' => 'Server does not advertise CardDAV (DAV header: '.$davHeader.').',
    ]);
}

Try / catch

use App\Domains\Contact\DavClient\Services\Utils\Dav\DavServerNotCompliantException;

try {
    app(CreateAddressBookSubscription::class)->execute($data);
} catch (DavServerNotCompliantException $e) {
    // not fixable from Monica: point at a real CardDAV server or fix the proxy
    report($e);
    throw ValidationException::withMessages(['base_uri' => $e->getMessage()]);
}

Prevention

When it happens

Trigger: Subscribing against a server whose OPTIONS DAV header lacks '1', '3' or 'addressbook': a plain WebDAV server (class 1 only), a CalDAV server without CardDAV support, a reverse proxy that strips the DAV header, or a server where the OPTIONS method is blocked so no DAV header comes back.

Common situations: nginx/Apache in front of the CardDAV server not passing the DAV header, pointing at a generic WebDAV mount or file server instead of a CardDAV server, or firewall/server rules that disable OPTIONS.

Related errors


AI-assisted analysis of monicahq/monica@e08e917341 (2026-08-17). Data as JSON: /api/errors/6ecf565fc36582f8. Report an issue: GitHub.