monicahq/monica · error · DavServerNotCompliantException

Server does not support rfc 6352 section 7.1.1 (CARD:address

Error message

Server does not support rfc 6352 section 7.1.1 (CARD:addressbook-home-set)

What it means

Once the current-user-principal is resolved, getAddressBookHome() PROPFINDs the principal for {card:}addressbook-home-set (RFC 6352 section 7.1.1), the property telling clients where the user's address book collections live. If getProperty returns null or empty — server does not implement the property, the principal URL is wrong, or the response is hidden behind auth — this DavServerNotCompliantException aborts discovery.

Source

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

            return $prop;
        }

        return $prop[0]['value'];
    }

    /**
     * Get addressbook url.
     *
     * @see https://datatracker.ietf.org/doc/html/rfc6352#section-7.1.1
     *
     * @throws DavServerNotCompliantException
     */
    private function getAddressBookHome(string $principal): string
    {
        $prop = $this->client->getProperty('{'.CardDav::NS_CARDDAV.'}addressbook-home-set', $principal);

        if (is_null($prop) || empty($prop)) {
            throw new DavServerNotCompliantException('Server does not support rfc 6352 section 7.1.1 (CARD:addressbook-home-set)');
        } elseif (is_string($prop)) {
            return $prop;
        }

        return $prop[0]['value'];
    }

    /**
     * Get Url for address book.
     */
    private function getAddressBookUrl(string $uri, int $depth = 0): ?string
    {
        $path = parse_url($uri, PHP_URL_PATH);

        $books = $this->client->propfind('{DAV:}resourcetype', depth: $depth, url: $uri);

        foreach ($books as $book => $properties) {
            if ($depth !== 0 && $book === $path) {

View on GitHub (pinned to e08e917341)

Solutions

  1. Bypass discovery by giving base_uri the exact address book collection URL
  2. Verify manually: authenticated PROPFIND on the principal asking for the card:addressbook-home-set property, confirm a 207 with an href
  3. Check that the principal URL from the previous discovery step resolves without redirect and is requested with credentials
  4. Upgrade the server to a CardDAV stack implementing RFC 6352 discovery (sabre/dav, Nextcloud, radicale, Baikal)
Defensive patterns

Strategy: validation

Validate before calling

// Preflight: confirm the principal advertises an addressbook-home-set
$prop = $davClient->getProperty('{urn:ietf:params:xml:ns:carddav}addressbook-home-set', $principalUrl);

if (is_null($prop) || empty($prop)) {
    throw ValidationException::withMessages([
        'base_uri' => 'Server does not advertise addressbook-home-set; supply the direct address book URL.',
    ]);
}

Try / catch

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

try {
    app(CreateAddressBookSubscription::class)->execute($data);
} catch (DavServerNotCompliantException $e) {
    if (str_contains($e->getMessage(), '7.1.1')) {
        // server principal lacks home-set: use direct collection URL as fallback input
    }
    throw $e;
}

Prevention

When it happens

Trigger: The principal was found, but PROPFIND on it returns no addressbook-home-set: CardDAV servers with incomplete discovery, a principal URL that 404s or redirects, or an unauthenticated PROPFIND answered without CardDAV properties.

Common situations: Servers implementing WebDAV principals but not CardDAV home-set discovery, redirected principal URLs (trailing-slash or host changes from the principal href), or reverse proxies mangling PROPFIND bodies.

Related errors


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