I'm happy to provide a vServer with an affected Nextcloud instance if needed. Just let me know.
{
"reqId": "XJEkVDoB8Qajy8bOA0WC",
"level": 2,
"time": "2026-07-01T16:57:02+00:00",
"remoteAddr": "XXX.XXX.XXX.XXX",
"user": "--",
"app": "context_chat",
"method": "GET",
"url": "/ocs/v2.php/apps/context_chat/queues/documents?n=32&format=json",
"scriptName": "/ocs/v2.php",
"message": "File not found or not a file",
"userAgent": "ExApp/context_chat_backend/5.4.0 (niquests/3.19.1)",
"version": "34.0.1.2",
"exception": {
"Exception": "Exception",
"Message": "File not found or not a file",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php",
"line": 125,
"function": "getFileSource",
"class": "OCA\\ContextChat\\Controller\\QueueController",
"type": "->",
"args": [
{ "__class__": "OCA\\ContextChat\\Db\\QueueFile", "id": 24118 },
{ "__class__": "OC\\Files\\Node\\LazyRoot" },
{ "__class__": "OCA\\ContextChat\\Service\\StorageService" },
{ "__class__": "OC\\Files\\Config\\UserMountCache" }
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 165,
"function": "getDocumentsQueueItems",
"class": "OCA\\ContextChat\\Controller\\QueueController",
"type": "->",
"args": [
{ "__class__": "OCA\\ContextChat\\Service\\StorageService" },
{ "__class__": "OC\\Files\\Node\\LazyRoot" },
{ "__class__": "OCA\\ContextChat\\Db\\QueueMapper" },
{ "__class__": "OCA\\ContextChat\\Db\\QueueContentItemMapper" },
{ "__class__": "OC\\Files\\Config\\UserMountCache" },
32
]
},
{
"file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
"line": 78,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [ { "__class__": "OCA\\ContextChat\\Controller\\QueueController" }, "getDocumentsQueueItems" ]
},
{
"file": "/var/www/html/lib/private/AppFramework/App.php",
"line": 137,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [ { "__class__": "OCA\\ContextChat\\Controller\\QueueController" }, "getDocumentsQueueItems" ]
},
{
"file": "/var/www/html/lib/private/Route/Router.php",
"line": 324,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\ContextChat\\Controller\\QueueController",
"getDocumentsQueueItems",
{ "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer" },
{ "_route": "ocs.context_chat.queue.getdocumentsqueueitems" }
]
},
{ "file": "/var/www/html/ocs/v1.php", "line": 63, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/ocsapp/apps/context_chat/queues/documents" ] },
{ "file": "/var/www/html/ocs/v2.php", "line": 10, "args": [ "/var/www/html/ocs/v1.php" ], "function": "require_once" }
],
"File": "/var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php",
"Line": 301,
"message": "File not found or not a file",
"exception": "{\"class\":\"Exception\",\"message\":\"File not found or not a file\",\"code\":0,\"file\":\"/var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php:301\",\"trace\":\"#0 /var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php(125): OCA\\ContextChat\\Controller\\QueueController->getFileSource(Object(OCA\\ContextChat\\Db\\QueueFile), Object(OC\\Files\\Node\\LazyRoot), Object(OCA\\ContextChat\\Service\\StorageService), Object(OC\\Files\\Config\\UserMountCache))\\n#1 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(165): OCA\\ContextChat\\Controller\\QueueController->getDocumentsQueueItems(Object(OCA\\ContextChat\\Service\\StorageService), Object(OC\\Files\\Node\\LazyRoot), Object(OCA\\ContextChat\\Db\\QueueMapper), Object(OCA\\ContextChat\\Db\\QueueContentItemMapper), Object(OC\\Files\\Config\\UserMountCache), 32)\\n#2 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(78): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\ContextChat\\Controller\\QueueController), 'getDocumentsQue...')\\n#3 /var/www/html/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\ContextChat\\Controller\\QueueController), 'getDocumentsQue...')\\n#4 /var/www/html/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('OCA\\\\ContextChat...', 'getDocumentsQue...', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#5 /var/www/html/ocs/v1.php(63): OC\\Route\\Router->match('/ocsapp/apps/co...')\\n#6 /var/www/html/ocs/v2.php(10): require_once('/var/www/html/o...')\\n#7 {main}\"}",
"CustomMessage": "File not found or not a file"
}
}
Which version of Nextcloud are you using?
v34.0.1
Which version of PHP context_chat are you using?
5.4.0
Which version of backend context_chat are you using?
5.4.0
Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.
Firefox 152.0.3
Nextcloud deployment method?
AIO
Describe the Bug
After installing
context_chatandcontext_chat_backend, I had the issue that only 1.7k of 10k eligible files were written to the vector database.When trying to debug the issue, I found a lot of
File not found or not a fileerrors triggered by the/ocs/v2.php/apps/context_chat/queues/documents?n=32&format=jsonendpoint. This happened even though I ran a full file scan before installing Context Chat.I think root cause is
$userId = $mounts[0]->getUser()->getUID()inOCA\ContextChat\Controller\QueueController::getFileSource().It chooses a user by taking the first mount returned from
IUserMountCache::getMountsForStorageId($storageId).On a storage with many shared mounts, the first result is not always the owner / it can belong to a user that cannot access the queued file ID.
In this case
getFirstNodeById($fileId)returns null andQueueControllerlogsFile not found or not a file.To Reproduce
32.0.0instance.owner,aaa, andbbb.owner, create an eligible test file:/owner/files/Test-Text.mdowner, create another folder on the same home storage:/owner/files/other/Test-Text.mdwithaaa.other/withbbb.aaaand openTest-Text.mdbbband openother/getMountsForStorageId()should be:33, then to Nextcloud34.$this->connection->truncateTable('mounts', false);in https://github.com/nextcloud/server/blob/stable34/core/Migrations/Version33000Date20251209123503.php#L28files:scan --allor similar, this will affect the next step.oc_mountsagain, but in a different order):getMountsForStorageId()again, the returned mount order should have changed:context_chat5.4.0andcontext_chat_backend.File not found or not a filein the logs, because$userId = $mounts[0]->getUser()->getUID();returns a user who doesn't have access toTest-Text.mdnow.I'm happy to provide a vServer with an affected Nextcloud instance if needed. Just let me know.
PHP logs (Warning these might contain sensitive information)
No response
Ex-App logs (Warning these might contain sensitive information)
No response
Server logs (if applicable)
{ "reqId": "XJEkVDoB8Qajy8bOA0WC", "level": 2, "time": "2026-07-01T16:57:02+00:00", "remoteAddr": "XXX.XXX.XXX.XXX", "user": "--", "app": "context_chat", "method": "GET", "url": "/ocs/v2.php/apps/context_chat/queues/documents?n=32&format=json", "scriptName": "/ocs/v2.php", "message": "File not found or not a file", "userAgent": "ExApp/context_chat_backend/5.4.0 (niquests/3.19.1)", "version": "34.0.1.2", "exception": { "Exception": "Exception", "Message": "File not found or not a file", "Code": 0, "Trace": [ { "file": "/var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php", "line": 125, "function": "getFileSource", "class": "OCA\\ContextChat\\Controller\\QueueController", "type": "->", "args": [ { "__class__": "OCA\\ContextChat\\Db\\QueueFile", "id": 24118 }, { "__class__": "OC\\Files\\Node\\LazyRoot" }, { "__class__": "OCA\\ContextChat\\Service\\StorageService" }, { "__class__": "OC\\Files\\Config\\UserMountCache" } ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 165, "function": "getDocumentsQueueItems", "class": "OCA\\ContextChat\\Controller\\QueueController", "type": "->", "args": [ { "__class__": "OCA\\ContextChat\\Service\\StorageService" }, { "__class__": "OC\\Files\\Node\\LazyRoot" }, { "__class__": "OCA\\ContextChat\\Db\\QueueMapper" }, { "__class__": "OCA\\ContextChat\\Db\\QueueContentItemMapper" }, { "__class__": "OC\\Files\\Config\\UserMountCache" }, 32 ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 78, "function": "executeController", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\ContextChat\\Controller\\QueueController" }, "getDocumentsQueueItems" ] }, { "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 137, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\ContextChat\\Controller\\QueueController" }, "getDocumentsQueueItems" ] }, { "file": "/var/www/html/lib/private/Route/Router.php", "line": 324, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\ContextChat\\Controller\\QueueController", "getDocumentsQueueItems", { "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer" }, { "_route": "ocs.context_chat.queue.getdocumentsqueueitems" } ] }, { "file": "/var/www/html/ocs/v1.php", "line": 63, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/ocsapp/apps/context_chat/queues/documents" ] }, { "file": "/var/www/html/ocs/v2.php", "line": 10, "args": [ "/var/www/html/ocs/v1.php" ], "function": "require_once" } ], "File": "/var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php", "Line": 301, "message": "File not found or not a file", "exception": "{\"class\":\"Exception\",\"message\":\"File not found or not a file\",\"code\":0,\"file\":\"/var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php:301\",\"trace\":\"#0 /var/www/html/custom_apps/context_chat/lib/Controller/QueueController.php(125): OCA\\ContextChat\\Controller\\QueueController->getFileSource(Object(OCA\\ContextChat\\Db\\QueueFile), Object(OC\\Files\\Node\\LazyRoot), Object(OCA\\ContextChat\\Service\\StorageService), Object(OC\\Files\\Config\\UserMountCache))\\n#1 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(165): OCA\\ContextChat\\Controller\\QueueController->getDocumentsQueueItems(Object(OCA\\ContextChat\\Service\\StorageService), Object(OC\\Files\\Node\\LazyRoot), Object(OCA\\ContextChat\\Db\\QueueMapper), Object(OCA\\ContextChat\\Db\\QueueContentItemMapper), Object(OC\\Files\\Config\\UserMountCache), 32)\\n#2 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(78): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\ContextChat\\Controller\\QueueController), 'getDocumentsQue...')\\n#3 /var/www/html/lib/private/AppFramework/App.php(137): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\ContextChat\\Controller\\QueueController), 'getDocumentsQue...')\\n#4 /var/www/html/lib/private/Route/Router.php(324): OC\\AppFramework\\App::main('OCA\\\\ContextChat...', 'getDocumentsQue...', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#5 /var/www/html/ocs/v1.php(63): OC\\Route\\Router->match('/ocsapp/apps/co...')\\n#6 /var/www/html/ocs/v2.php(10): require_once('/var/www/html/o...')\\n#7 {main}\"}", "CustomMessage": "File not found or not a file" } }