Node for share not found error
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Type something in searchbar
Expected behaviour
List of Files, Decks, Talks etc. containing the searchstring should be listet.
Actual behaviour
Everything gets listet except the files. An error ist displayed "an error occured while searching files". Browser Console shows 404 Error.
Server configuration
Operating system: Linux 3.10.0-1127.8.2.el7.x86_64 x86_64 Web server: Database: mysql, 5.5.68 PHP version: 7.4.13 Nextcloud version: 20.0.04 Updated from an older Nextcloud/ownCloud or fresh install: updated Where did you install Nextcloud from:
Signing status:
Signing status
Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
List of activated apps:
App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Nextcloud configuration:
Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder
or
Insert your config.php content here.
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
Are you using external storage, if yes which one: No
Are you using encryption: no
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Chrome 87 Operating system: Ubuntu 20.04, macOS Catalina
Logs
Web server error log
Web server error log
Insert your webserver log here
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"X@s8LatSMh1UY@RRHdRuwwAAAIQ","level":3,"time":"2020-12-29T14:24:48+00:00","remoteAddr":"127.0.0.1","user":"alex","app":"no app in context","method":"GET","url":"/ocs/v2.php/search/providers/files/search?term=XXXFIXME&from=%2Fcall%2Fpbk83vcj","message":{"Exception":"OCP\\Files\\NotFoundException","Message":"Node for share not found, fileid: 139230","Code":0,"Trace":[{"file":"/var/www/vhosts/example.com/www/lib/private/Share20/Share.php","line":236,"function":"getNode","class":"OC\\Share20\\Share","type":"->"},{"file":"/var/www/vhosts/example.com.ch/www/apps/files_sharing/lib/SharedStorage.php","line":367,"function":"getNodeType","class":"OC\\Share20\\Share","type":"->"},{"function":"getItemType","class":"OCA\\Files_Sharing\\SharedStorage","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/Files/Storage/Wrapper/Wrapper.php","line":507,"function":"call_user_func_array"},{"file":"/var/www/vhosts/example.com/www/apps/files_sharing/lib/Cache.php","line":183,"function":"__call","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"function":"search","class":"OCA\\Files_Sharing\\Cache","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/Files/View.php","line":1667,"function":"call_user_func_array"},{"file":"/var/www/vhosts/example.com/www/lib/private/Files/View.php","line":1599,"function":"searchCommon","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/Files/Filesystem.php","line":763,"function":"search","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/Search/Provider/File.php","line":47,"function":"search","class":"OC\\Files\\Filesystem","type":"::"},{"file":"/var/www/vhosts/example.com.ch/www/apps/files/lib/Search/FilesSearchProvider.php","line":120,"function":"search","class":"OC\\Search\\Provider\\File","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/Search/SearchComposer.php","line":162,"function":"search","class":"OCA\\Files\\Search\\FilesSearchProvider","type":"->"},{"file":"/var/www/vhosts/example.com/www/core/Controller/UnifiedSearchController.php","line":110,"function":"search","class":"OC\\Search\\SearchComposer","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"search","class":"OC\\Core\\Controller\\UnifiedSearchController","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/vhosts/example.com/www/lib/private/Route/Router.php","line":308,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/vhosts/example.com/www/ocs/v1.php","line":88,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/vhosts/example.com/www/ocs/v2.php","line":24,"args":["/var/www/vhosts/example.com/www/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/vhosts/example.com/www/lib/private/Share20/Share.php","Line":190,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0","version":"20.0.4.0","id":"5feb3c308390f"}Browser log
Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
{
"reqId": "X@s8LatSMh1UY@RRHdRuwwAAAIQ",
"level": 3,
"time": "2020-12-29T14:24:48+00:00",
"remoteAddr": "127.0.0.1",
"user": "alex",
"app": "no app in context",
"method": "GET",
"url": "/ocs/v2.php/search/providers/files/search?term=XXXFIXME&from=%2Fcall%2Fpbk83vcj",
"message": {
"Exception": "OCP\\Files\\NotFoundException",
"Message": "Node for share not found, fileid: 139230",
"Code": 0,
"Trace": [
{
"file": "/var/www/vhosts/example.com/www/lib/private/Share20/Share.php",
"line": 236,
"function": "getNode",
"class": "OC\\Share20\\Share",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com.ch/www/apps/files_sharing/lib/SharedStorage.php",
"line": 367,
"function": "getNodeType",
"class": "OC\\Share20\\Share",
"type": "->"
},
{
"function": "getItemType",
"class": "OCA\\Files_Sharing\\SharedStorage",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Files/Storage/Wrapper/Wrapper.php",
"line": 507,
"function": "call_user_func_array"
},
{
"file": "/var/www/vhosts/example.com/www/apps/files_sharing/lib/Cache.php",
"line": 183,
"function": "__call",
"class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
"type": "->"
},
{
"function": "search",
"class": "OCA\\Files_Sharing\\Cache",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Files/View.php",
"line": 1667,
"function": "call_user_func_array"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Files/View.php",
"line": 1599,
"function": "searchCommon",
"class": "OC\\Files\\View",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Files/Filesystem.php",
"line": 763,
"function": "search",
"class": "OC\\Files\\View",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Search/Provider/File.php",
"line": 47,
"function": "search",
"class": "OC\\Files\\Filesystem",
"type": "::"
},
{
"file": "/var/www/vhosts/example.com.ch/www/apps/files/lib/Search/FilesSearchProvider.php",
"line": 120,
"function": "search",
"class": "OC\\Search\\Provider\\File",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Search/SearchComposer.php",
"line": 162,
"function": "search",
"class": "OCA\\Files\\Search\\FilesSearchProvider",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/core/Controller/UnifiedSearchController.php",
"line": 110,
"function": "search",
"class": "OC\\Search\\SearchComposer",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/AppFramework/Http/Dispatcher.php",
"line": 169,
"function": "search",
"class": "OC\\Core\\Controller\\UnifiedSearchController",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/AppFramework/Http/Dispatcher.php",
"line": 100,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/AppFramework/App.php",
"line": 152,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/lib/private/Route/Router.php",
"line": 308,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/vhosts/example.com/www/ocs/v1.php",
"line": 88,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/vhosts/example.com/www/ocs/v2.php",
"line": 24,
"args": [
"/var/www/vhosts/example.com/www/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/var/www/vhosts/example.com/www/lib/private/Share20/Share.php",
"Line": 190,
"CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0",
"version": "20.0.4.0",
"id": "5feb3c308390f"
}
It seems you have a broken share. You can find the share by running
SELECT * FROM `oc_share` WHERE `file_source` = 139230;
on your database
Then you can check what share it is and manually delete it if you feel like it. I'm not sure running a files:scan would clean the invalid shares.
running files:scan didn't fix the issue.
the mentioned sql command revealed a shared folder, but deleting this folder didn't help either.
the issue might be: user A shares the folder (group Alpha and users B to E in this case). the folder is located in a groupfolder of group Beta, which user belongs to at this time. Later user A gets removed from group Beta. Share is broken, and search for users B to E doesn't work.
the above mentioned is not the cause. other shares cause problems, without users leaving groups. but leaving the broken share fixes the issues. the question is, why are the shares broken?
@fhirter in my case there was a file shared to another person and then deleted - before the share was revoked.
the link in the DB was not deleted, but setting the share_with column to NULL fixed the issue.
We had this issue. I went in and looked at all the applicable entries in our database with the file_source entry that showed up in our logs. I then went and looked at the files and figured out which file didn't exist anymore, and removed those lines in the database one by one. Search is now working again.
Looks like the shares did not get deleted properly when the file was deleted.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Well it would be good to know which info is needed. I answered all the questions.
The issue is not resolved, fiddling with the database can't be the solution. The question is, why are these bad shares happening at all?
Hi! Thanks for the help everyone!
Can you test the patch in https://github.com/nextcloud/server/pull/26411 ? :)
See https://github.com/nextcloud/server/pull/26411
This happens in latest v22, isn't that commit e198dc1 included?
{
"reqId": "5nyjmyhZ2oEdxcE8qk6U",
"level": 3,
"time": "2022-09-06T12:38:25+00:00",
"app": "no app in context",
"method": "POST",
"url": "/ocs/v2.php/apps/files_sharing/api/v1/shares",
"message": "Node for share not found, fileid: 61504727",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
"version": "22.2.10.0",
"exception": {
"Exception": "OCP\\Files\\NotFoundException",
"Message": "Node for share not found, fileid: 61504727",
"Code": 0,
"Trace": [
{
"file": "/app/lib/private/Share20/LegacyHooks.php",
"line": 161,
"function": "getNode",
"class": "OC\\Share20\\Share",
"type": "->",
"args": []
},
{
"file": "/app/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 264,
"function": "postShare",
"class": "OC\\Share20\\LegacyHooks",
"type": "->",
"args": [
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
},
"OCP\\Share::postShare",
{
"__class__": "Symfony\\Component\\EventDispatcher\\EventDispatcher"
}
]
},
{
"file": "/app/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 239,
"function": "doDispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
},
{
"__class__": "Closure"
},
{
"__class__": "Closure"
}
],
"OCP\\Share::postShare",
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
}
]
},
{
"file": "/app/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line": 73,
"function": "callListeners",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
[
{
"__class__": "Closure"
},
{
"__class__": "Closure"
},
{
"__class__": "Closure"
}
],
"OCP\\Share::postShare",
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
}
]
},
{
"file": "/app/lib/private/EventDispatcher/SymfonyAdapter.php",
"line": 123,
"function": "dispatch",
"class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type": "->",
"args": [
{
"__class__": "OC\\EventDispatcher\\GenericEventWrapper"
},
"OCP\\Share::postShare"
]
},
{
"file": "/app/lib/private/Share20/Manager.php",
"line": 820,
"function": "dispatch",
"class": "OC\\EventDispatcher\\SymfonyAdapter",
"type": "->",
"args": [
"OCP\\Share::postShare",
{
"__class__": "Symfony\\Component\\EventDispatcher\\GenericEvent"
}
]
},
{
"file": "/app/apps/files_sharing/lib/Controller/ShareAPIController.php",
"line": 661,
"function": "createShare",
"class": "OC\\Share20\\Manager",
"type": "->",
"args": [
{
"__class__": "OC\\Share20\\Share"
}
]
},
{
"file": "/app/lib/private/AppFramework/Http/Dispatcher.php",
"line": 217,
"function": "createShare",
"class": "OCA\\Files_Sharing\\Controller\\ShareAPIController",
"type": "->",
"args": [
{
"__class__": "OC\\Files\\Node\\Folder"
},
31,
0,
"xxx",
"false",
"",
null,
"",
""
]
},
{
"file": "/app/lib/private/AppFramework/Http/Dispatcher.php",
"line": 126,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareAPIController"
},
"createShare"
]
},
{
"file": "/app/lib/private/AppFramework/App.php",
"line": 156,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->",
"args": [
{
"__class__": "OCA\\Files_Sharing\\Controller\\ShareAPIController"
},
"createShare"
]
},
{
"file": "/app/lib/private/Route/Router.php",
"line": 302,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::",
"args": [
"OCA\\Files_Sharing\\Controller\\ShareAPIController",
"createShare",
{
"__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
},
{
"_route": "ocs.files_sharing.ShareAPI.createShare"
}
]
},
{
"file": "/app/ocs/v1.php",
"line": 62,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->",
"args": [
"/ocsapp/apps/files_sharing/api/v1/shares"
]
},
{
"file": "/app/ocs/v2.php",
"line": 23,
"args": [
"/app/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/app/lib/private/Share20/Share.php",
"Line": 190,
"CustomMessage": "--"
},
"id": "631760490f92a"
}