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

[Bug]: Trouble accessing data for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces is enabled w/ external storage and ldap #42663

Open
6 of 8 tasks
supr4s opened this issue Jan 9, 2024 · 24 comments · Fixed by nextcloud/text#6155
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: external storage feature: ldap

Comments

@supr4s
Copy link

supr4s commented Jan 9, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

Hi everyone,

We have a whole group of LDAP users who connect to the Nextcloud with external storage (SMB/CIFS) that maps automatically as soon as the user logs on.
Since upgrading to 28.0.1, some users are accessing network folders but nothing is visible (No files) and I'm getting generation errors at the same time :

{"reqId":"M3EwBxeysCLR3Dnko63W","level":3,"time":"2024-01-09T15:33:50+00:00","remoteAddr":"x.x.x.x","user":"74C480CF-3D78-496B-AA68-A3E7A3C2ACE3","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/74C480CF-3D78-496B-AA68-A3E7A3C2ACE3/DONNEES/","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/srv/nextcloud/www/apps/text/lib/DAV/WorkspacePlugin.php","line":119,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"OCA\\Text\\DAV\\{closure}","class":"OCA\\Text\\DAV\\WorkspacePlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/www/apps/text/lib/DAV/WorkspacePlugin.php","line":117,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"OCA\\Text\\DAV\\WorkspacePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Server.php","line":370,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/remote.php","line":172,"args":["/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/lib/private/Files/Node/File.php","Line":56,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}}

So the network folder is accessible, but when it is accessed, everything remains empty and an error is generated.

I can't reproduce the problem for everyone, only for certain users. For example, user A will have access while user B won't (even though on the Active Directory and Nextcloud sides they have exactly the same rights and permissions, they're practically identical profiles).

I came across an issue that seems similar, as we also use Collabora :

https://help.nextcloud.com/t/ocp-files-genericfileexception-in-file-php-nach-occ-app-update-all/175085/2

Despite deactivating the richdocuments and richdocumentscode plugins, nothing to do still the same. I've also disabled preview and ACL checking in the external storage settings, but the problem persists. I also have the same problem if I create a share manually from the user account, in addition to the share done automatically at login.

I also tried to delete the LDAP user from Nextcloud but it was impossible ((Is it possible to force the deletion and then reconnect as if from scratch? That would be a good idea) :

sudo -u nextcloud php /srv/nextcloud/www/occ user:delete <UUID>
The specified user could not be deleted. Please check the logs.

I also deleted his Nextcloud user profile folder, then reconnected, but that didn't work.

The size of the folder is displayed, and you can access it (a sign that the link is working), but as soon as you access it, everything is empty.

Steps to reproduce

  • Set up LDAP authentication
  • Set up automatic network mounting on user login (SMB)
  • On access, folder mounts, can be accessed but Nextcloud displays it as empty

Expected behavior

The contents of the folder are displayed.

Installation method

None

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 22 to 23)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xxx.myclient.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.1.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "default_phone_region": "FR_fr",
        "trashbin_retention_obligation": "auto",
        "skeletondirectory": "",
        "force_language": "fr",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 1.5
        },
        "log_type": "file",
        "logfile": "\/srv\/nextcloud\/www\/data\/nextcloud.log",
        "loglevel": 2,
        "theme": "",
        "maintenance": false,
        "versions_retention_obligation": "auto, 3",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - auto_groups: 1.5.2
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_lock: 28.0.1
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - related_resources: 1.3.0
  - settings: 1.10.1
  - smb_test: 0.3.8
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0
  - viewer: 2.2.0
  - workflowengine: 2.10.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"M3EwBxeysCLR3Dnko63W","level":3,"time":"2024-01-09T15:33:50+00:00","remoteAddr":"x.x.x.x","user":"74C480CF-3D78-496B-AA68-A3E7A3C2ACE3","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/74C480CF-3D78-496B-AA68-A3E7A3C2ACE3/DONNEES/","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/srv/nextcloud/www/apps/text/lib/DAV/WorkspacePlugin.php","line":119,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"OCA\\Text\\DAV\\{closure}","class":"OCA\\Text\\DAV\\WorkspacePlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/www/apps/text/lib/DAV/WorkspacePlugin.php","line":117,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"OCA\\Text\\DAV\\WorkspacePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Server.php","line":370,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/remote.php","line":172,"args":["/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/lib/private/Files/Node/File.php","Line":56,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}}

Additional info

No response

@supr4s supr4s added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 9, 2024
@joshtrichards
Copy link
Member

Something makes me think the final error in that stack trace may be a red herring, but to semi-rule that out you can try disabling rich workspaces globally to see if there is any change: occ config:app:set text workspace_available --value=0 (restart your app/FPM server for good measure after doing so).

Are there any other log entries from the point of trying to log-in and the provided stack trace?

It might be informative to lower your loglevel temporarily, to 1 and - if still nothing interesting - to 0 (DEBUG) briefly.

@supr4s
Copy link
Author

supr4s commented Jan 10, 2024

Hi @joshtrichards ,

Thanks for you quick feedback !

Well, it looks like you've found the problem.

One :

occ config:app:set text workspace_available --value=0

Fix the problem, everything working's again.

If i re-active rick workspace :

occ config:app:set text workspace_available --value=1

The problem returns.

FYI, here are the logs when log verbosity is set on 0 :

{"reqId":"AYLZKwmJTQSPx2pKrtAb","level":3,"time":"2024-01-10T08:38:48+00:00","remoteAddr":"x.x.x.x","user":"F146EBCF-9C26-42F9-A10D-D83394C1A610","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/F146EBCF-9C26-42F9-A10D-D83394C1A610/DONNEES/","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/srv/nextcloud/www/apps/text/lib/DAV/WorkspacePlugin.php","line":119,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"OCA\\Text\\DAV\\{closure}","class":"OCA\\Text\\DAV\\WorkspacePlugin","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/srv/nextcloud/www/apps/text/lib/DAV/WorkspacePlugin.php","line":117,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"OCA\\Text\\DAV\\WorkspacePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/apps/dav/lib/Server.php","line":370,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},
{"file":"/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/www/remote.php","line":172,"args":["/srv/nextcloud/www/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/www/lib/private/Files/Node/File.php","Line":56,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"}}

Can we consider this a bug with the latest server version (28.0.1)?

Thanks again for your help !

@svenseeberg
Copy link

We have the same issue but without SMB shares. occ config:app:set text workspace_available --value=0 fixed it.

@joshtrichards
Copy link
Member

@svenseeberg Anything else similar to the original reporter's environment? LDAP auth perhaps?

@joshtrichards
Copy link
Member

joshtrichards commented Jan 10, 2024

Can we consider this a bug with the latest server version (28.0.1)?

Or the text app (which admittedly is a standard app so the short answer would be "yes" 😄 ):

https://github.com/nextcloud/text/blob/c7bd53f796469fad9601b1c892eff15c9a394e33/lib/DAV/WorkspacePlugin.php#L103-L129

The bit of code here has been tweaked a few times for performance (though not recently). I think lines 116-128 more properly belong up under the if at 107 but it'll require a closer look. I'm also hesitant to make the change blindly since this bit of code has been static for 2 years and was a little hairy to mess with then it looks like (nextcloud/text#2608), so there may be something else going on here triggering this suddenly now for you.

For example, I don't see any problem in a stock install (i.e. without LDAP).

@joshtrichards joshtrichards changed the title [Bug]: Trouble accessing data on an SMB share for certain users: "Exception thrown: OCP\Files\GenericFileException" [Bug]: Trouble accessing data on an SMB share for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces are enabled Jan 11, 2024
@joshtrichards joshtrichards changed the title [Bug]: Trouble accessing data on an SMB share for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces are enabled [Bug]: Trouble accessing data for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces is enabled Jan 11, 2024
@brotkastn
Copy link

brotkastn commented Jan 17, 2024

I can confirm the issue - and the workaround mentioned in this comment above .

The weird thing is: we have ~10 Users all but one via LDAP. Only one had trouble accessing their files, others seemed fine.

Thank you for the quick workaround, and have a nice day :)

@piotr-sikora-v
Copy link

I had same issue

occ config:app:set text workspace_available --value=0 

fixed it

@svenseeberg
Copy link

@svenseeberg Anything else similar to the original reporter's environment? LDAP auth perhaps?

Sorry for the late answer. Yes, LDAP Auth.

The weird thing is: we have ~10 Users all but one via LDAP. Only one had trouble accessing their files, others seemed fine.

And this is also true in my case.

@joshtrichards joshtrichards changed the title [Bug]: Trouble accessing data for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces is enabled [Bug]: Trouble accessing data for certain users: "Exception thrown: OCP\Files\GenericFileException" when Rich Workspaces is enabled w/ external storage and ldap Jan 23, 2024
@Helios07
Copy link

I have the same issue. From my experience, it occurs only for folders where a user doesn't have read permissions to all objects within.

@SECtim
Copy link

SECtim commented Mar 21, 2024

I don't think this is in any way related to encryption or LDAP - I had the same issue for a WebDAV external storage, and the proposed workaround occ config:app:set text workspace_available --value=0 fixed the issue for me (though I'd really like to use the Text app in the Files listings).

To clarify: My instance does not use LDAP authentication, nor does it use sever-side encryption.

@h4de5
Copy link

h4de5 commented Apr 17, 2024

same problem here. as soon as I disable it it works.

@alx-tuilmenau
Copy link
Contributor

Same problem here, NC 28.0.5, LDAP enabled.

Log { "reqId": "wUyGLN68GLTPX9hjr4xA", "level": 3, "time": "2024-05-23T07:26:33+00:00", "remoteAddr": "xxx", "user": "xxx", "app": "webdav", "method": "PROPFIND", "url": "/remote.php/dav/files/xxx/", "message": "Exception thrown: OCP\\Files\\GenericFileException", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0", "version": "28.0.5.1", "exception": { "Exception": "OCP\\Files\\GenericFileException", "Message": "", "Code": 0, "Trace": [ { "file": "/data/nextcloud_a1/apps/text/lib/DAV/WorkspacePlugin.php", "line": 119, "function": "getContent", "class": "OC\\Files\\Node\\File", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/PropFind.php", "line": 95, "function": "OCA\\Text\\DAV\\{closure}", "class": "OCA\\Text\\DAV\\WorkspacePlugin", "type": "->", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/data/nextcloud_a1/apps/text/lib/DAV/WorkspacePlugin.php", "line": 117, "function": "handle", "class": "Sabre\\DAV\\PropFind", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/event/lib/WildcardEmitterTrait.php", "line": 89, "function": "propFind", "class": "OCA\\Text\\DAV\\WorkspacePlugin", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 1052, "function": "emit", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 984, "function": "getPropertiesByNode", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 1662, "function": "getPropertiesIteratorForPath", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 1647, "function": "writeMultiStatus", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/CorePlugin.php", "line": 346, "function": "generateMultiStatus", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/event/lib/WildcardEmitterTrait.php", "line": 89, "function": "httpPropFind", "class": "Sabre\\DAV\\CorePlugin", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 472, "function": "emit", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 253, "function": "invokeMethod", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/3rdparty/sabre/dav/lib/DAV/Server.php", "line": 321, "function": "start", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/apps/dav/lib/Server.php", "line": 373, "function": "exec", "class": "Sabre\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/apps/dav/appinfo/v2/remote.php", "line": 35, "function": "exec", "class": "OCA\\DAV\\Server", "type": "->" }, { "file": "/data/nextcloud_a1/remote.php", "line": 172, "args": [ "/data/nextcloud_a1/apps/dav/appinfo/v2/remote.php" ], "function": "require_once" } ], "File": "/data/nextcloud_a1/lib/private/Files/Node/File.php", "Line": 56, "message": "", "exception": {}, "CustomMessage": "Exception thrown: OCP\\Files\\GenericFileException" } }

@bstin
Copy link

bstin commented Jun 11, 2024

Had the same problem. No LDAP, but user files where on SMB share. Setting occ config:app:set text workspace_available --value=0 resolved

@zenlord
Copy link
Contributor

zenlord commented Jul 22, 2024

Same problem here. NC 29.0.3 and 29.0.4. Fixed with proposed fix here (although I used the GUI to just entirely disable the 'Text' app). Users authenticate via LDAP plugin. External storage is a local volume that is mounted over NFS outside of NC.

@AnAnalogGuy
Copy link

Same problem here. NC 29.0.4. "Fixed" with proposed fix.
Only local user database and authentication, no ldap.
External storage via SMB and SFTP.
Problem only happens on the local storage, not on the external storages.

More info here: https://help.nextcloud.com/t/after-updating-to-29-0-4-users-have-lost-access-to-the-local-file-system/198810/6

@kesselb
Copy link
Contributor

kesselb commented Jul 25, 2024

It looks like a good idea to wrap $file->getContent() in a try-catch-block: https://github.com/nextcloud/text/blob/c7bd53f796469fad9601b1c892eff15c9a394e33/lib/DAV/WorkspacePlugin.php#L119

The exceptions are documented in the file class.

/**
* @return string
* @throws NotPermittedException
* @throws GenericFileException
* @throws LockedException
*/

The case, that the file content is unavailable for whatever reason, should not break the propfind request.

It could be related to #37943.

cc @come-nc @juliushaertl

@juliusknorr
Copy link
Member

Makes sense.

cc @elzody i think you had a similar report where we did not have logs when we talked about that.

@AnAnalogGuy
Copy link

AnAnalogGuy commented Jul 26, 2024

The case, that the file content is unavailable for whatever reason, should not break the propfind request.

With "file content" are you refering to "external storage"?

If yes, I would like to point to an aspect, which might play a role here: In my installation, i have 3 external storages, all in the same subnet and connections are up. However, i run into this issue unless I turn off rich workspace. Now, while searching for the root case, i was looking into the database and in the oc_storages table i not only found these 3 configured external storages (with all its related records per user) which are also shown in the UI plus the records for the local storages, but a bunch of additional records pointing to external storages which have been deleted a long time ago and which do not show up in the UI.

Some thoughts regarding these (potential) findings:

  • Not sure if this is a wanted behaviour or not, but why would we want to keep records for deleted external storages in the database? If this is done by intention, i would question if this makes sense (and how someone ever should be able to remove this dead records as they don't pop up in the UI). Otherwise it might indicate a defect in the deletion process for external storages. The interesting part here is that the records which should be deleted point to the same external storage HOST with the same user but DIFFERENT paths. This might be where deletion goes wrong.
  • Since the 3 valid external storage hosts in my setup are available and I still run into this issue, could it be this "dead" records are the reason? Turning on DEBUG loglevel i got the impression NC tries to connect to all external storages found in the table, which of course then leads to "not available" for those not valid any longer (which should have been deleted in the db).

Since i don't know the intention of the developers regarding the "external storages old db records deleteion process" i have not done a deeper investigation. In case the developers think this could be an issue, just ping me and I will support tracking this down as good as i can (if needed).

@AnAnalogGuy
Copy link

AnAnalogGuy commented Aug 2, 2024

Just applied nextcloud/text#6155, set occ config:app:set text workspace_available --value=1 and a short test confirms the problem i encountered is gone now (files are shown on local and external storages).

--

However, there still are tons of GenericFileExceptions in the logs (don't seem to come from the same code but at the same time seem to be related to the text app):

[index] Error: Exception thrown: OCP\Files\GenericFileException
	PUT /index.php/apps/text/session/794422/create

--

Also, i found:

  • On the top directory of an available external storage/SMB drive, this warning is shown. Text/content seems to be missing.
    grafik
  • On two other availabe external storage/SMB drives, neither the text area nor an error is shown.
    grafik
  • On an available external storage/SFTP drive, the text area is displayed.
    grafik

I don't know which behaviour is intended by the developers, but from a user point of view, this looks inconsistent and maybe indicates another issue.

@kesselb
Copy link
Contributor

kesselb commented Aug 2, 2024

On an available external storage/SFTP drive, the text area is displayed.

Isn't that just the content of the README.md file on your sftp storage? ;)

@kesselb
Copy link
Contributor

kesselb commented Aug 2, 2024

On the top directory of an available external storage/SMB drive, this warning is shown. Text/content seems to be missing.

Mind checking the xhr response in your browser's network tools? It should contain the error message and make it easier for us to figure out the problem.

@AnAnalogGuy
Copy link

On an available external storage/SFTP drive, the text area is displayed.

Isn't that just the content of the README.md file on your sftp storage? ;)

Yes, it is. So there it's working correctly. Just waned to document that the basic mechanism seems to work.

@AnAnalogGuy
Copy link

AnAnalogGuy commented Aug 2, 2024

On the top directory of an available external storage/SMB drive, this warning is shown. Text/content seems to be missing.

Mind checking the xhr response in your browser's network tools? It should contain the error message and make it easier for us to figure out the problem.

Any specific property to identify the related xhr response (as there is quite a bunch of xhr messages i receive)? I checked all xhr messages and couldn't find any containing an error code/message, however, the jsons sometimes are bit hard to read so i could have missed it.

--

Refering to the issue i encounter on the SMB drive:

  • There is an empty readme.md on the related drive. It has been created by Nextcloud.

  • When i open the readme.md file in Nextcloud the same warning box is displayed.

  • When i open it in a text editor, it's just an empty file, nothing special about it.

  • Also i checked the user permissions which should be fine

  • On the http layer the only error i can see is a 500 Internal Server Error as response to a PUT request:
    https://nextcloud.domain.com/index.php/apps/text/session/794708/create
    grafik

  • I opened readme.md in a file editor and added one line of text "This comment has been created opening the file in a text editor.",

  • When reloading the directory view on the SMB driver in Nextcloud, for the blink of an eye i can see the content from that file rendered to the text area and instantly getting replaced by this empty error message.
    grafik
    grafik
    Same behaviour when i open the readme.md - the content is shown in the editor/viewer for a short time and then the warning box is shown.

So, i deleted the readme.md on that smb share. Nextcloud now does not display that warning box again but also no text area is offered, so no readme.md could be created.
grafik.
Also in the browser's network tab that PUT request "create" doesn't appear anymore.

--

I conclude the problem doesn't seem to be (direclty) related to the original defect/issue.

It somehow seems the basic functionality is working (as the content can be read and is displayed) but then some other mechanism kicks in leading displaying the warning box instead.

@AnAnalogGuy
Copy link

The problem i reported above i was able to track down to issues in the handling of file permission in the related php smb library. So it's not related to this tickets root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: external storage feature: ldap
Projects
Status: 📄 To do (~10 entries)
Development

Successfully merging a pull request may close this issue.