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

Entity does not exist or is not available

Error message

Entity does not exist or is not available

What it means

Before handing out an object's comment collection, EntityTypeCollection::getChild() asks the entity type's childExists callback (registered per entity, e.g. by the files app) whether the object exists. If the callback returns false, the collection itself is refused with NotFound('Entity does not exist or is not available'), HTTP 404 — no comment lookup happens.

Source

Thrown at apps/dav/lib/Comments/EntityTypeCollection.php:60

		$this->name = $name;
		$this->commentsManager = $commentsManager;
		$this->userSession = $userSession;
	}

	/**
	 * 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) {
		if (!$this->childExists($name)) {
			throw new NotFound('Entity does not exist or is not available');
		}
		return new EntityCollection(
			$name,
			$this->name,
			$this->commentsManager,
			$this->userManager,
			$this->userSession,
			$this->logger
		);
	}

	/**
	 * Returns an array with all the child nodes
	 *
	 * @return \Sabre\DAV\INode[]
	 * @throws MethodNotAllowed
	 */
	#[\Override]

View on GitHub (pinned to ecdeb153ff)

Solutions

  1. Verify the file/object id exists and is visible to the user before addressing its comments.
  2. Refetch the object id at comment time instead of caching it long-term.
  3. Handle 404 on the collection as 'object gone' and clean up dependent client state.
Defensive patterns

Strategy: validation

Validate before calling

if (!$objectExists($objectType, $objectId)) { // e.g. file id lookup before commenting
    throw new ObjectGoneException($objectType . ' ' . $objectId . ' no longer exists');
}
$commentsUrl = '/remote.php/dav/comments/' . $objectType . '/' . $objectId . '/';

Try / catch

try {
    $client->propfind($commentsUrl, [], 1);
} catch (NotFound $e) { // HTTP 404: the object itself is gone
    removeObjectFromUi($objectId);
}

Prevention

When it happens

Trigger: PROPFIND/POST/GET on /remote.php/dav/comments/files/<fileId> where <fileId> does not exist: the file was deleted, the id is wrong, or it belongs to another instance.

Common situations: Commenting on a file that was deleted between page load and submit; wrong file id after share or federation changes; hardcoded ids from a test environment used against production.

Related errors


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