{"record":{"id":"b64d9f90063c2505","repo":"monicahq/monica","slug":"server-does-not-support-rfc-6352-section-7-1-1-ca","errorCode":null,"errorMessage":"Server does not support rfc 6352 section 7.1.1 (CARD:addressbook-home-set)","messagePattern":"Server does not support rfc 6352 section 7\\.1\\.1 \\(CARD:addressbook-home-set\\)","errorType":"exception","errorClass":"DavServerNotCompliantException","httpStatus":null,"severity":"error","filePath":"app/Domains/Contact/DavClient/Services/Utils/AddressBookGetter.php","lineNumber":191,"sourceCode":"            return $prop;\n        }\n\n        return $prop[0]['value'];\n    }\n\n    /**\n     * Get addressbook url.\n     *\n     * @see https://datatracker.ietf.org/doc/html/rfc6352#section-7.1.1\n     *\n     * @throws DavServerNotCompliantException\n     */\n    private function getAddressBookHome(string $principal): string\n    {\n        $prop = $this->client->getProperty('{'.CardDav::NS_CARDDAV.'}addressbook-home-set', $principal);\n\n        if (is_null($prop) || empty($prop)) {\n            throw new DavServerNotCompliantException('Server does not support rfc 6352 section 7.1.1 (CARD:addressbook-home-set)');\n        } elseif (is_string($prop)) {\n            return $prop;\n        }\n\n        return $prop[0]['value'];\n    }\n\n    /**\n     * Get Url for address book.\n     */\n    private function getAddressBookUrl(string $uri, int $depth = 0): ?string\n    {\n        $path = parse_url($uri, PHP_URL_PATH);\n\n        $books = $this->client->propfind('{DAV:}resourcetype', depth: $depth, url: $uri);\n\n        foreach ($books as $book => $properties) {\n            if ($depth !== 0 && $book === $path) {","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/monicahq/monica/blob/e08e91734170b6bbd582cb578532c3948196124e/app/Domains/Contact/DavClient/Services/Utils/AddressBookGetter.php#L173-L209","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Bypass discovery by giving base_uri the exact address book collection URL","Verify manually: authenticated PROPFIND on the principal asking for the card:addressbook-home-set property, confirm a 207 with an href","Check that the principal URL from the previous discovery step resolves without redirect and is requested with credentials","Upgrade the server to a CardDAV stack implementing RFC 6352 discovery (sabre/dav, Nextcloud, radicale, Baikal)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Preflight: confirm the principal advertises an addressbook-home-set\n$prop = $davClient->getProperty('{urn:ietf:params:xml:ns:carddav}addressbook-home-set', $principalUrl);\n\nif (is_null($prop) || empty($prop)) {\n    throw ValidationException::withMessages([\n        'base_uri' => 'Server does not advertise addressbook-home-set; supply the direct address book URL.',\n    ]);\n}","typeGuard":null,"tryCatchPattern":"use App\\Domains\\Contact\\DavClient\\Services\\Utils\\Dav\\DavServerNotCompliantException;\n\ntry {\n    app(CreateAddressBookSubscription::class)->execute($data);\n} catch (DavServerNotCompliantException $e) {\n    if (str_contains($e->getMessage(), '7.1.1')) {\n        // server principal lacks home-set: use direct collection URL as fallback input\n    }\n    throw $e;\n}","preventionTips":["Keep the direct address book collection URL documented per provider so discovery is optional","Verify principal URLs resolve without redirects before relying on them","Request principal properties with authentication attached","Prefer RFC 6352-compliant server stacks (sabre/dav and derivatives)"],"tags":["carddav","dav","rfc6352","home-set","discovery"],"backgroundTag":"carddav-home-set-missing","analyzedSha":"e08e91734170b6bbd582cb578532c3948196124e","analyzedAt":"2026-08-17T01:36:49.014Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}