{"record":{"id":"030c8a79dcffabfd","repo":"nextcloud/server","slug":"updating-remote-user-principal-is-not-supported","errorCode":null,"errorMessage":"Updating remote user principal is not supported","messagePattern":"Updating remote user principal is not supported","errorType":"exception","errorClass":"Sabre\\DAV\\Exception","httpStatus":500,"severity":"warning","filePath":"apps/dav/lib/DAV/RemoteUserPrincipalBackend.php","lineNumber":70,"sourceCode":"\t\t\treturn null;\n\t\t}\n\n\t\tif (isset($this->principalsByPath[$path])) {\n\t\t\treturn $this->principalsByPath[$path];\n\t\t}\n\n\t\ttry {\n\t\t\t$principal = $this->principalUriToPrincipal($path);\n\t\t} catch (\\Exception $e) {\n\t\t\t$principal = null;\n\t\t}\n\t\t$this->principalsByPath[$path] = $principal;\n\t\treturn $principal;\n\t}\n\n\t#[\\Override]\n\tpublic function updatePrincipal($path, \\Sabre\\DAV\\PropPatch $propPatch) {\n\t\tthrow new \\Sabre\\DAV\\Exception('Updating remote user principal is not supported');\n\t}\n\n\t#[\\Override]\n\tpublic function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') {\n\t\t// Searching is not supported\n\t\treturn [];\n\t}\n\n\t#[\\Override]\n\tpublic function findByUri($uri, $principalPrefix) {\n\t\tif (str_starts_with($uri, 'principal:')) {\n\t\t\t$principal = substr($uri, strlen('principal:'));\n\t\t\t$principal = $this->getPrincipalByPath($principal);\n\t\t\tif ($principal !== null) {\n\t\t\t\treturn $principal['uri'];\n\t\t\t}\n\t\t}\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/DAV/RemoteUserPrincipalBackend.php#L52-L88","documentation":"RemoteUserPrincipalBackend::updatePrincipal() (apps/dav/lib/DAV/RemoteUserPrincipalBackend.php:70) unconditionally throws \\Sabre\\DAV\\Exception when a PROPPATCH targets a federated remote user principal (principals/system/... remote-user collections). This backend resolves cloud IDs (federated users) read-only; their display name and properties live on the remote server, so local updates are architecturally impossible and rejected.","triggerScenarios":"A WebDAV PROPPATCH request (e.g. setting {DAV:}displayname) on a principal URI under the remote-users principal collection, typically issued by CalDAV/CardDAV clients or tooling that iterates all principals and attempts to edit them.","commonSituations":"Address-book/CardDAV clients trying to rename federated share contacts; automation scripts doing PROPPATCH over every principal returned by a principal-property-search; ACL managers attempting bulk property updates.","solutions":["Do not PROPPATCH remote user principals; restrict updates to local principals under principals/users/<uid>.","Change a federated user's display name on their own server — the cloud ID display string is resolved from there.","In client code, skip principals whose path contains the remote/system principal prefix before issuing PROPPATCH.","If a client misbehaves, report/handle the 500 per Sabre semantics and continue with remaining principals instead of aborting the batch."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// only PROPPATCH local user principals; never remote/system ones\nif (preg_match('#^principals/(users|groups)/#', $principalUri)) {\n    $backend->updatePrincipal($principalUri, $propPatch);\n} else {\n    $this->skip('Read-only principal: ' . $principalUri);\n}","typeGuard":"function isLocalEditablePrincipal(string $uri): bool {\n    return (bool)preg_match('#^principals/(users|groups)/[^/]+$#', $uri);\n}","tryCatchPattern":"try {\n    $backend->updatePrincipal($path, $propPatch);\n} catch (\\Sabre\\DAV\\Exception $e) {\n    if (str_contains($e->getMessage(), 'not supported')) {\n        $this->skip($path); // expected for read-only backends\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Filter principal collections by backend capability before sending PROPPATCH.","Remember that federated user properties live on their home server — update there.","Bulk tools should tolerate per-principal failures and continue."],"tags":["dav","principal","federation","proppatch","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}