{"record":{"id":"495cf23473a7466b","repo":"nextcloud/server","slug":"principal-not-found","errorCode":null,"errorMessage":"Principal not found","messagePattern":"Principal not found","errorType":"exception","errorClass":"Sabre\\DAV\\Exception","httpStatus":500,"severity":"error","filePath":"apps/dav/lib/Connector/Sabre/Principal.php","lineNumber":196,"sourceCode":"\t/**\n\t * Returns the list of groups a principal is a member of\n\t *\n\t * @param string $principal\n\t * @param bool $needGroups\n\t * @return array\n\t * @throws Exception\n\t */\n\t#[\\Override]\n\tpublic function getGroupMembership($principal, $needGroups = false) {\n\t\t[$prefix, $name] = \\Sabre\\Uri\\split($principal);\n\n\t\tif ($prefix !== $this->principalPrefix) {\n\t\t\treturn [];\n\t\t}\n\n\t\t$user = $this->userManager->get($name);\n\t\tif (!$user) {\n\t\t\tthrow new Exception('Principal not found');\n\t\t}\n\n\t\t$groups = [];\n\n\t\tif ($this->hasGroups || $needGroups) {\n\t\t\t$userGroups = $this->groupManager->getUserGroups($user);\n\t\t\tforeach ($userGroups as $userGroup) {\n\t\t\t\tif ($userGroup->hideFromCollaboration()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$groups[] = 'principals/groups/' . urlencode($userGroup->getGID());\n\t\t\t}\n\t\t}\n\n\t\t$groups = array_unique(array_merge(\n\t\t\t$groups,\n\t\t\t$this->traitGetGroupMembership($principal, $needGroups)\n\t\t));","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Connector/Sabre/Principal.php#L178-L214","documentation":"Error \"Principal not found\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/dav/lib/Connector/Sabre/Principal.php:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}