Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node for share not found error #24891

Closed
fhirter opened this issue Dec 29, 2020 · 11 comments
Closed

Node for share not found error #24891

fhirter opened this issue Dec 29, 2020 · 11 comments
Labels
3. to review Waiting for reviews bug

Comments

@fhirter
Copy link

fhirter commented Dec 29, 2020

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

  1. 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) ...
@fhirter fhirter added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 29, 2020
@skjnldsv
Copy link
Member

{
  "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"
}

@skjnldsv
Copy link
Member

skjnldsv commented Dec 30, 2020

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.

@fhirter
Copy link
Author

fhirter commented Jan 12, 2021

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.

@fhirter
Copy link
Author

fhirter commented Jan 21, 2021

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?

@mandrivaman
Copy link

@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.

@mxroo
Copy link

mxroo commented Feb 2, 2021

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.

@ghost

This comment was marked as resolved.

@ghost ghost added the stale Ticket or PR with no recent activity label Mar 4, 2021
@fhirter
Copy link
Author

fhirter commented Mar 5, 2021

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?

@ghost ghost removed the stale Ticket or PR with no recent activity label Mar 5, 2021
@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of 2. developing Work in progress and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info 1. to develop Accepted and waiting to be taken care of labels Apr 2, 2021
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 2, 2021
@skjnldsv
Copy link
Member

skjnldsv commented Apr 2, 2021

Hi! Thanks for the help everyone!

Can you test the patch in #26411 ? :)

@solracsf solracsf changed the title An error occured while searching files Node for share not found error Sep 6, 2022
@skjnldsv skjnldsv closed this as completed Sep 6, 2022
@skjnldsv
Copy link
Member

skjnldsv commented Sep 6, 2022

See #26411

@solracsf
Copy link
Member

solracsf commented Sep 6, 2022

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"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants