nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.33k stars 4.06k forks source link

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

Open supr4s opened 9 months ago

supr4s commented 9 months ago

⚠️ 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

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?

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

joshtrichards commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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

joshtrichards commented 9 months ago

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

joshtrichards commented 9 months ago

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" :smile: ):

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

brotkastn commented 9 months ago

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 commented 9 months ago

I had same issue

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

fixed it

svenseeberg commented 9 months ago

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

Helios07 commented 9 months ago

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 commented 7 months ago

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 commented 6 months ago

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

alx-tuilmenau commented 5 months ago

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 commented 4 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.

https://github.com/nextcloud/server/blob/dae7c159f728a90ffa53247d6e033abdae5d2bd6/lib/private/Files/Node/File.php#L25-L30

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

It could be related to https://github.com/nextcloud/server/pull/37943.

cc @come-nc @juliushaertl

juliusknorr commented 3 months ago

Makes sense.

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

AnAnalogGuy commented 3 months ago

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:

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 commented 3 months ago

Just applied https://github.com/nextcloud/text/pull/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:

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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:

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 commented 2 months ago

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.