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]: files app bugs out when setting an external storage as root storage #32367

Closed
5 of 8 tasks
Tracked by #669
szaimen opened this issue May 12, 2022 · 15 comments · Fixed by #32797
Closed
5 of 8 tasks
Tracked by #669

[Bug]: files app bugs out when setting an external storage as root storage #32367

szaimen opened this issue May 12, 2022 · 15 comments · Fixed by #32797

Comments

@szaimen
Copy link
Contributor

szaimen commented May 12, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

After the upgrade to 24.0.0 Nextcloud bugs out when trying to open the files app if you have set an external storage as root storage. I get this error message: This directory is not available, please check the log files or contact the administrator. and the filelist is blank.

Steps to reproduce

  1. be on 23.0.4
  2. enable the external storage app
  3. create an external storage like this: image
  4. open the files app -> works
  5. upgrade to 24.0.0
  6. try to open the files app
  7. -> bugs out. (see above)

Expected behavior

It should open the files app as usual

Installation method

Official VM scripts

Operating system

Debian/Ubuntu

PHP engine version

PHP 7.4

Web server

Apache (supported)

Database engine version

PostgreSQL

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

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

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": [
            "localhost",
            "192.168.146.128",
            "nextcloud40gb",
            "nextcloud40gb"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "24.0.0.12",
        "overwrite.cli.url": "https:\/\/nextcloud40gb\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "upgrade.disable-web": true,
        "log_type": "file",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": "2",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "mail_smtpmode": "smtp",
        "remember_login_cookie_lifetime": "1800",
        "log_rotate_size": "10485760",
        "trashbin_retention_obligation": "auto, 60",
        "versions_retention_obligation": "auto, 180",
        "activity_expire_days": "120",
        "simpleSignUpLink.shown": false,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0.5,
            "dbindex": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "default_phone_region": "us",
        "logtimezone": "Etc\/UTC",
        "htaccess.RewriteBase": "\/",
        "maintenance": false
    }
}

List of activated Apps

- accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - calendar: 3.3.0
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.1.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - deck: 1.7.0
  - extract: 1.3.5
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_external: 1.16.1
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - mail: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - encryption
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{
  "reqId": "4aIORDmw3VUYz5fgQgGO",
  "level": 4,
  "time": "2022-05-12T19:19:32+00:00",
  "remoteAddr": "192.168.146.1",
  "user": "admin",
  "app": "webdav",
  "method": "PROPFIND",
  "url": "/remote.php/dav/files/admin/",
  "message": "Could not create folder",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36 Edg/101.0.1210.39",
  "version": "24.0.0.12",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "Could not create folder",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyUserFolder.php",
        "line": 48,
        "function": "newFolder",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->"
      },
      {
        "function": "OC\\Files\\Node\\{closure}",
        "class": "OC\\Files\\Node\\LazyUserFolder",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 69,
        "function": "call_user_func"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 208,
        "function": "__call",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Node.php",
        "line": 247,
        "function": "getId",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/text/lib/DAV/WorkspacePlugin.php",
        "line": 102,
        "function": "getId",
        "class": "OCA\\DAV\\Connector\\Sabre\\Node",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "propFind",
        "class": "OCA\\Text\\DAV\\WorkspacePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1052,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 984,
        "function": "getPropertiesByNode",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1662,
        "function": "getPropertiesIteratorForPath",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1647,
        "function": "writeMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 346,
        "function": "generateMultiStatus",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpPropFind",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Server.php",
        "line": 352,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/remote.php",
        "line": 166,
        "args": [
          "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Files/Node/Folder.php",
    "Line": 164,
    "CustomMessage": "--"
  },
  "id": "627d5dcbbe435"
}

Additional info

No response

@szaimen szaimen changed the title [Bug]: Nextcloud bugs out when setting an external storage as root storage [Bug]: files app bugs out when setting an external storage as root storage May 12, 2022
@PVince81
Copy link
Member

ohhh, is this even supported ?

@icewind1991 any ideas on this one ?

@szaimen
Copy link
Contributor Author

szaimen commented May 13, 2022

ohhh, is this even supported ?

Yes it was introduced as a feature a few years ago. I can try to find the PR that added this if needed.

Problem is that if that does not work anymore it might break the whole thing for some instamces because they would need to change the external storage configuration which would mean that oc_filecache would be completely exchanged with all drawbacks that come with it.

@szaimen szaimen closed this as completed May 13, 2022
@szaimen szaimen reopened this May 13, 2022
@szaimen

This comment was marked as resolved.

@PVince81
Copy link
Member

I'm guessing this is related to the recent mount point performance optimizations, where we probably didn't think about this unusual kind of moint point. I suppose that the fix here would be to detect root mounts and exclude them from the "on-demand" logic and have them always resolved.

@Whatnoww
Copy link

Thank you for your response. I've been suffering this issue recently as well. Oddly enough there are no issues when displaying the files on the Android app and you can manually access the files by their directory name in the address bar.

@syntron
Copy link

syntron commented May 22, 2022

I'm from [Bug]: Directory not available / Error loading data] #32541 - this seems to be the case for external data, i.e. from another computer via smb or federation. A locally mounted NFS share as external source works well.

@sebabordon
Copy link

Found out I have the same problem. For some reason, My Domain Admin account works well, but others do not. No issues on the log after enabling debug

@vicelversa
Copy link

vicelversa commented May 25, 2022

Also running into this issue on Nextcloud 24. Here is the original PR for this feature: #3438

Note that I am using an S3 bucket as external storage mounted to '/'

@peacepenguin
Copy link

Running into this issue too. @sebabordon thanks for your domain admin hint. I've now found i can make the issue go away by explicitly granting permission to the SMB user on the share. For some reason this works. "BOB" - windows user configured in nextcloud external storage for the mapping, when granted "Full Control" over c:\nextcloudroots\bob now i can mount his folder as "/" like before.

Previously BOB was a member of "NextcloudRoots" local windows group, that group has Full Control of the same folder structure. In this model the "/" root mapping no longer works in v24, but mapping to "/external/" works fine. So it's not a full-on permissions issue, but somehow related to how permissions are given in Windows.

It's like the issue has to do with group membership somehow, doesn't make sense, but a workaround nonetheless for now.

@sebabordon
Copy link

Running into this issue too. @sebabordon thanks for your domain admin hint. I've now found i can make the issue go away by explicitly granting permission to the SMB user on the share. For some reason this works. "BOB" - windows user configured in nextcloud external storage for the mapping, when granted "Full Control" over c:\nextcloudroots\bob now i can mount his folder as "/" like before.

Previously BOB was a member of "NextcloudRoots" local windows group, that group has Full Control of the same folder structure. In this model the "/" root mapping no longer works in v24, but mapping to "/external/" works fine. So it's not a full-on permissions issue, but somehow related to how permissions are given in Windows.

It's like the issue has to do with group membership somehow, doesn't make sense, but a workaround nonetheless for now.

Good to know it works for you!, however, my permissions on an the SMB share (Samba Home share) are granted to creator owner and the user account itself, with everyone full control as share permissions. I have been fiddling with permissions before posting a bug, so now it is properly secured but issue remains. I could try share permissions as well.

@peacepenguin
Copy link

I tried the explicit permissions workaround on another instance with php7.4 instead of 8.1. And the workaround does not work with 7.4. So another variable to this problem.

@peacepenguin
Copy link

Any update? This bug is a regression and needs fixed, otherwise the documentation needs to be updated to reflect external storage mapping to user's root '/' is now unsupported.

@icewind1991
Copy link
Member

should be fixed with #32797

@szaimen szaimen added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Jun 9, 2022
@Kramins
Copy link

Kramins commented Jan 15, 2023

I understand this issue is closed but I am experiencing the same issue with Nextcloud 25.0.2
I can see all the files on the website however on the client and webdav, I don't see any file updates and the root folder only contains the default files from the original /data folder.

@szaimen
Copy link
Contributor Author

szaimen commented Jan 15, 2023

Hi, please open a new bug report about this with up-to-date information. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants