nextcloud/server · warning · Sabre\DAV\Exception\NotFound

Entity type "$name" not found."

Error message

Entity type "$name" not found."

What it means

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.

Solutions

  1. Use 'files' unless an app explicitly registers the target entity type.
  2. Grep the codebase or app docs for CommentsEntityEvent listeners to learn which types exist on your instance.
  3. Fix typos in the entity-type path segment.

Example fix

// before: HTTP 404 Entity type "file" not found.
$client->propfind('/remote.php/dav/comments/file/123/', []);

// after: registered entity type
$client->propfind('/remote.php/dav/comments/files/123/', []);
Defensive patterns

Strategy: validation

Validate before calling

$knownTypes = ['files']; // extend with entity types registered by apps on your instance
if (!in_array($entityType, $knownTypes, true)) {
    throw new InvalidArgumentException('Unknown comments entity type: ' . $entityType);
}
$url = '/remote.php/dav/comments/' . $entityType . '/' . $objectId . '/';

Prevention

When it happens

Trigger: 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'.

Common situations: Assuming arbitrary object types are commentable; disabling an app that registered a type while clients keep requesting it; URL typos in hand-written integrations.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17). Data as JSON: /api/errors/b12821bee4d19753. Report an issue: GitHub.

Appendix: source

Thrown at apps/dav/lib/Comments/RootCollection.php:109

	}

	/**
	 * Returns a specific child node, referenced by its name
	 *
	 * This method must throw Sabre\DAV\Exception\NotFound if the node does not
	 * exist.
	 *
	 * @param string $name
	 * @return \Sabre\DAV\INode
	 * @throws NotFound
	 */
	#[\Override]
	public function getChild($name) {
		$this->initCollections();
		if (isset($this->entityTypeCollections[$name])) {
			return $this->entityTypeCollections[$name];
		}
		throw new NotFound('Entity type "' . $name . '" not found."');
	}

	/**
	 * Returns an array with all the child nodes
	 *
	 * @return \Sabre\DAV\INode[]
	 */
	#[\Override]
	public function getChildren() {
		$this->initCollections();
		assert(!is_null($this->entityTypeCollections));
		return $this->entityTypeCollections;
	}

	/**
	 * Checks if a child-node with the specified name exists
	 *
	 * @param string $name

View on GitHub (pinned to ecdeb153ff)