{"record":{"id":"b12821bee4d19753","repo":"nextcloud/server","slug":"entity-type-name-not-found","errorCode":null,"errorMessage":"Entity type \"$name\" not found.\"","messagePattern":"Entity type \"\\$name\" not found\\.\"","errorType":"http","errorClass":"Sabre\\DAV\\Exception\\NotFound","httpStatus":404,"severity":"warning","filePath":"apps/dav/lib/Comments/RootCollection.php","lineNumber":109,"sourceCode":"\t}\n\n\t/**\n\t * Returns a specific child node, referenced by its name\n\t *\n\t * This method must throw Sabre\\DAV\\Exception\\NotFound if the node does not\n\t * exist.\n\t *\n\t * @param string $name\n\t * @return \\Sabre\\DAV\\INode\n\t * @throws NotFound\n\t */\n\t#[\\Override]\n\tpublic function getChild($name) {\n\t\t$this->initCollections();\n\t\tif (isset($this->entityTypeCollections[$name])) {\n\t\t\treturn $this->entityTypeCollections[$name];\n\t\t}\n\t\tthrow new NotFound('Entity type \"' . $name . '\" not found.\"');\n\t}\n\n\t/**\n\t * Returns an array with all the child nodes\n\t *\n\t * @return \\Sabre\\DAV\\INode[]\n\t */\n\t#[\\Override]\n\tpublic function getChildren() {\n\t\t$this->initCollections();\n\t\tassert(!is_null($this->entityTypeCollections));\n\t\treturn $this->entityTypeCollections;\n\t}\n\n\t/**\n\t * Checks if a child-node with the specified name exists\n\t *\n\t * @param string $name","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Comments/RootCollection.php#L91-L127","documentation":"The first path segment under /remote.php/dav/comments must be an entity type registered by a CommentsEntityEvent listener ('files' by default; apps may register more). Anything else throws NotFound with 'Entity type \"<name>\" not found.' — note the stray trailing quote in the literal source string — HTTP 404.","triggerScenarios":"GET/PROPFIND on /remote.php/dav/comments/<unknownType>/... where no listener registered <unknownType>; typo'd segments such as 'file' (singular) or 'document' instead of 'files'.","commonSituations":"Assuming arbitrary object types are commentable; disabling an app that registered a type while clients keep requesting it; URL typos in hand-written integrations.","solutions":["Use 'files' unless an app explicitly registers the target entity type.","Grep the codebase or app docs for CommentsEntityEvent listeners to learn which types exist on your instance.","Fix typos in the entity-type path segment."],"exampleFix":"// before: HTTP 404 Entity type \"file\" not found.\n$client->propfind('/remote.php/dav/comments/file/123/', []);\n\n// after: registered entity type\n$client->propfind('/remote.php/dav/comments/files/123/', []);","handlingStrategy":"validation","validationCode":"$knownTypes = ['files']; // extend with entity types registered by apps on your instance\nif (!in_array($entityType, $knownTypes, true)) {\n    throw new InvalidArgumentException('Unknown comments entity type: ' . $entityType);\n}\n$url = '/remote.php/dav/comments/' . $entityType . '/' . $objectId . '/';","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain the list of entity types your instance registers and validate URLs against it.","Watch for apps being enabled/disabled: they add or remove comment entity types.","Double-check the segment spelling ('files', not 'file')."],"tags":["dav","comments","routing","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}