nextcloud/server · warning · Sabre\DAV\Exception\NotFound
File with name {} could not be located
Error message
File with name {} could not be located What it means
Thrown by ObjectTree::getNodeForPath() (apps/dav/lib/Connector/Sabre/ObjectTree.php:125) as \Sabre\DAV\Exception\NotFound (HTTP 404) when fileView->getFileInfo($path) returned a falsy value without throwing. The path lookup completed but no FileInfo could be produced — the file genuinely is not there as far as the filesystem/cache is concerned.
Source
Thrown at apps/dav/lib/Connector/Sabre/ObjectTree.php:125
try {
$info = $this->fileView->getFileInfo($path);
if ($info instanceof \OCP\Files\FileInfo && $info->getStorage()->instanceOfStorage(FailedStorage::class)) {
throw new StorageNotAvailableException();
}
} catch (StorageNotAvailableException $e) {
throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage is temporarily not available', 0, $e);
} catch (StorageInvalidException $e) {
throw new \Sabre\DAV\Exception\NotFound('Storage ' . $path . ' is invalid');
} catch (LockedException $e) {
throw new \Sabre\DAV\Exception\Locked();
} catch (ForbiddenException $e) {
throw new \Sabre\DAV\Exception\Forbidden();
}
}
if (!$info) {
throw new \Sabre\DAV\Exception\NotFound('File with name ' . $path . ' could not be located');
}
if ($info->getType() === 'dir') {
$node = new Directory($this->fileView, $info, $this);
} else {
$node = new File($this->fileView, $info);
}
$this->cache[$path] = $node;
return $node;
}
/**
* Copies a file or directory.
*
* This method must work recursively and delete the destination
* if it exists
*View on GitHub (pinned to ecdeb153ff)
Solutions
- Re-list the parent folder (PROPFIND depth 1) and update local state; if the file is gone, remove the local ghost entry or re-upload if it should exist.
- If the file definitely exists in the web UI but DAV says 404, run occ files:scan --user <uid> to rebuild the file cache for that user.
- In client code, treat 404 on GET as authoritative and reconcile instead of retrying.
- Check the trashbin (remote.php/dav/trash-bin/) if the file was deleted and needs restoring.
Defensive patterns
Strategy: try-catch
Try / catch
try {
$node = $server->tree->getNodeForPath($path);
} catch (\Sabre\DAV\Exception\NotFound $e) {
// authoritative absence: re-list parent and reconcile local state
$this->refreshFolderListing(dirname($path));
$this->localState->removeGhost($path); Prevention
- Re-list (PROPFIND depth 1) before acting on cached paths older than the last sync.
- Treat 404 on GET/PROPFIND as authoritative and reconcile instead of retrying.
- Check the trashbin before re-uploading irreplaceable files.
When it happens
Trigger: GET/PROPFIND on a file deleted moments before (client cache stale after another device removed it); a path that never existed (client-side ghost entry); filecache/cache inconsistency where the parent dir lists an entry but getFileInfo can no longer resolve it (e.g. after crashes during delete).
Common situations: Two devices syncing: device A deletes, device B still issues a request; interrupted deletions or moves leaving stale cache entries; clients constructing paths from old listings after a remote rename; race between PROPFIND listing and subsequent GET.
Related errors
- Node not found
- Card not found
- Card not found
- Entity does not exist or is not available
- Entity type "$name" not found."
AI-assisted analysis of nextcloud/server@ecdeb153ff (2026-08-17).
Data as JSON: /api/errors/a9ea49e60dbfdb02.
Report an issue: GitHub.