server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: File sharing on External Storage isn't working anymore since NC 26 upgrade (PHP 8.2)

Open SofianeLasri opened this issue 2 years ago • 31 comments

⚠️ This issue respects the following points: ⚠️

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

Bug description

Since I upgraded to Nextcloud 26, the file sharing for external storage is broken. An error message that simply say "Error while creating the share" appear on the screen, and a detailed error log shows up in the console. This one told us that the POST query result in a 404 error. Then, when we goes to the logs page in the admin dashboard, a very simple message about the error appear: Share type does not allow to emit interaction event. But, if we refresh the page on the same folder, we will see that the file/folder is now shared. But we can't copy it link. And if we have it (because the link was shared before this problem occured), the link ends in a 404 error page.

This error only occurs on external storage (smb, sftp & ftp), not on /data storage.

Steps to reproduce

  1. Connect an external storage.
  2. Enter to the newly added folder for this external storage.
  3. Create/Select a file and try creating a link for sharing it.

Expected behavior

A link for this file is created and accessible to the public.

Installation method

Community Web installer on a VPS or web space

Operating system

Debian/Ubuntu

PHP engine version

Other

Web server

Apache (supported)

Database engine version

MariaDB

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?

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

Configuration report

system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.sl-projects.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.0.11",
        "overwrite.cli.url": "https:\/\/cloud.sl-projects.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin"
        ],
        "twofactor_enforced_excluded_groups": [],
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "tls",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "default_phone_region": "FR",
        "allow_local_remote_servers": true,
        "updater.release.channel": "stable",
        "overwriteprotocol": "https",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\Movie",
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\MP4",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\PDF"
        ],
        "app_install_overwrite": [
            "maps",
            "files_downloadactivity"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 2.18.0
  - admin_audit: 1.16.0
  - audioplayer: 3.3.1
  - bruteforcesettings: 2.6.0
  - calendar: 4.3.1
  - camerarawpreviews: 0.8.1
  - circles: 26.0.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contacts: 5.2.0
  - contactsinteraction: 1.7.0
  - dashboard: 7.6.0
  - dav: 1.25.0
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_downloadactivity: 1.16.0
  - files_external: 1.18.0
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - firstrunwizard: 2.15.0
  - forms: 3.2.0
  - groupfolders: 14.0.0
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - mail: 3.0.2
  - nextcloud_announcements: 1.15.0
  - notes: 4.7.2
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - password_policy: 1.16.0
  - photos: 2.2.0
  - previewgenerator: 5.2.1
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - recognize: 3.7.0
  - recommendations: 1.5.0
  - related_resources: 1.1.0-alpha1
  - richdocuments: 8.0.0
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - smb_test: 0.3.6
  - sociallogin: 5.4.2
  - support: 1.9.0
  - survey_client: 1.14.0
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0
  - tasks: 0.14.5
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - twofactor_totp: 8.0.0-alpha.0
  - updatenotification: 1.16.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - workflowengine: 2.8.0
Disabled:
  - encryption: 2.14.0 (installed 2.13.0)
  - extract: 1.3.5 (installed 1.3.5)
  - files_photospheres: 1.26.0 (installed 1.26.0)
  - maps: 0.2.4 (installed 0.2.4)
  - quota_warning: 1.15.0 (installed 1.15.0)
  - richdocumentscode: 22.5.802 (installed 22.5.802)
  - spreed: 16.0.1 (installed 16.0.1)
  - user_ldap: 1.16.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"Fvqw7mi8jrZxoIQwS5X2","level":0,"time":"2023-03-26T20:46:33+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"PHP","method":"GET","url":"/index.php/settings/admin/logging","message":"Creation of dynamic property OCA\\FirstRunWizard\\Settings\\Personal::$urlGenerator is deprecated at /home/serveur-web/cloud.sl-projects.com/apps/firstrunwizard/lib/Settings/Personal.php#40","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"Fvqw7mi8jrZxoIQwS5X2","level":0,"time":"2023-03-26T20:46:33+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"logreader","method":"GET","url":"/index.php/settings/admin/logging","message":"Could not find resource file \"/apps/logreader/css/../js/logreader-main.css\"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":{"app":"logreader"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"3iNRKWuKizgEKt6mJabh","level":0,"time":"2023-03-26T20:46:58+00:00","remoteAddr":"172.71.134.73","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000022","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#496","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"HI8zj62lnUZ4OBQhye0k","level":0,"time":"2023-03-26T20:47:14+00:00","remoteAddr":"172.71.134.154","user":"SofianeLasri","app":"PHP","method":"PUT","url":"/remote.php/dav/uploads/SofianeLasri/334594318/0000000000000023","message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /home/serveur-web/cloud.sl-projects.com/lib/private/Files/Cache/Scanner.php#499","userAgent":"Mozilla/5.0 (Windows) mirall/3.7.4stable-Win64 (build 20230309) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"26.0.0.11","data":{"app":"PHP"}}
{"reqId":"55PLpBZZTuGL62cF6fAz","level":1,"time":"2023-03-26T20:47:50+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Deprecated event type for OCP\\Share::preShare: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":[]}
{"reqId":"55PLpBZZTuGL62cF6fAz","level":1,"time":"2023-03-26T20:47:50+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Deprecated event type for OCP\\Share::postShare: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":[]}
{"reqId":"55PLpBZZTuGL62cF6fAz","level":0,"time":"2023-03-26T20:47:50+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"hiding hidden file .nomedia","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":[]}
{"reqId":"55PLpBZZTuGL62cF6fAz","level":0,"time":"2023-03-26T20:47:50+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"related_resources","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"flush cache","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":{"app":"related_resources"}}
{"reqId":"55PLpBZZTuGL62cF6fAz","level":0,"time":"2023-03-26T20:47:50+00:00","remoteAddr":"172.71.131.190","user":"SofianeLasri","app":"files_sharing","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Share type does not allow to emit interaction event","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51","version":"26.0.0.11","data":{"app":"files_sharing"}}

Additional info

This a not a permission issue, the sharing right is checked in the admin dashboard. If we uncheck it, an error message that tolds us we don't have the permission shows up. I am now on PHP 8.2 and php8.2-smbclient is installed.

SofianeLasri avatar Mar 26 '23 20:03 SofianeLasri

I have exactly the same problem. -NC 26.0.0 Hub4 -PHP 8.2 -nginx

I've tried everything, it feels like. -read + write to the share via NC -share permissions and ACL set to "everyone" for test purposes -can create and edit folders from NC on the share, etc. -can create new text files (.md) from NC on the share, but I get an error when opening (file not found or something like that) The file is created, though.

SubZero84 avatar Mar 27 '23 20:03 SubZero84

Oh, update.

I have found a workaround for myself.

If you create the share not in the "User" area but "Admin" area (and make it available to the users), everything works. More specifically: Administration settings -> Administration -> External Storage (don't forget to enable "allow share")

SubZero84 avatar Mar 27 '23 20:03 SubZero84

Same problem here: working on external SMB/CIFS storages that are created using administration-setup for external drives are working well (opening text-files with nextcloud-editor or OnlyOffice) but using the personal-setup for external storages is not working (neither editing nor sharing). OnlyOffice shows "File not found" and the internal nextcloud-editor shows a large exclamation-mark "File could not be opened". The protocol is not helpful at this point...

xn--nding-jua avatar Mar 28 '23 14:03 xn--nding-jua

Umm, I have to extend the problem: regular file-shares are (partially) not working, too: on another machine with Nextcloud 26 some regular public-shares are not available any more. On one password-protected share the password is requested but after the password is typed in the message "Page not found: The page could not be found on the server.". Another public-link is working fine. On this machine I'm not using SMB/CIFS but regular ext4-file-system.

Some other weired things:

  • on another user the shares are working as expected - so it seems to be user-related, too.
  • some folders in my installation allows creating new (working) shares and other folders say I'm not allowed to create this share

So there seems to be a problem with the shares and maybe rights-problem: when trying to change the password on the damaged public-share an error-message is shown: "Du bist nicht berechtigt, XXX zu teilen." and "Fehler beim Aktualisieren der Freigabe: Du bist nicht berechtigt, XXX zu teilen." means "You are not allowed to share XXX." and "Error updating share: You are not allowed to share XXX.". But even with this error-message a new share-entry is created within the SQL-database. So in general the function is working as expected, but something is blocking here?

Any suggestions?

xn--nding-jua avatar Mar 29 '23 18:03 xn--nding-jua

Another update and how I fixed the problem: Somehow the IDs of some folders changed. The folder where I had problems on sharing had a non-working "internal file-link" that directed to a totally different folder that was an external FTP-share. I removed the external sharepoint and suddenly Nextcloud lost the information about my problematic folder, too, and reindexed everything resulting in a new ID for this folder and losing ALL shares... All connected clients deleted the removed folder, too.

Now I had to update all shares using phpMyAdmin and direct the shares in the table "oc_share" to the updated IDs in the columns "item_source" and "file_source" manually. Now all shares are working again with the original token and password...

This is working on one of my machines where only few users are installed... But for my larger installation I cannot do this yet. There seems to be a general bug in Nextcloud 26 using file-links: the internal links should be resolved like this: https://cloud.nextcloud.de/index.php/f/{FILEID} this should be resolved to this https://cloud.nextcloud.de/index.php/apps/files/?dir=/{FOLDERNAME}&fileid={FILEID}

But for mounted external storages (only using personal setup - administration setup is working) the following will happen: https://cloud.nextcloud.de/index.php/f/{FILEID} this is resolved a fileNotFound url: https://cloud.nextcloud.de/index.php/apps/files/?fileNotFound=1 resulting in redirection to the main-folder: _https://cloud.nextcloud.de/index.php/apps/files/?dir=/&fileid={SOMEGENERALFILEID}

xn--nding-jua avatar Mar 29 '23 20:03 xn--nding-jua

The same thing seems to have happened on my instance: For some folders on some users creating and accessing file shares doesn't work anymore and the logs seem to be as if it tried to access a certain external drive even though the folder I'm trying to share is not an external one.

This is a pretty big issue imo... Let's hope it can be fixed retroactively in an update

DerGenaue avatar Mar 29 '23 21:03 DerGenaue

I'm still searching the code for an issue and maybe the culprit lies here: https://github.com/nextcloud/server/commits/master/lib/private/Files/Config/UserMountCache.php

This file has been updated and is directly related to the UserMount-Points... tomorrow I will try to find a solution...

xn--nding-jua avatar Mar 29 '23 21:03 xn--nding-jua

I can reproduce the issue where the "internal link" somehow points to that external drive:

Fetching the internal share link for /folder gives me some internal share link: https://some.next.cloud/f/1337 That one resolves to: https://some.next.cloud/apps/files/?dir=/external_drive/files/folder (html encoded parameter obv.)

which is completely the wrong location and obviously doesn't exist...

DerGenaue avatar Mar 29 '23 21:03 DerGenaue

Maybe problem is related to issue https://github.com/nextcloud/server/pull/21049 But obviously something has changed between NC25 and NC26

xn--nding-jua avatar Mar 29 '23 21:03 xn--nding-jua

I did a bit of sniffing around my database and the entries in the tables appear to be perfectly fine at first glance. Currently following the /f/{fileid} request trough the code hoping to figure out how the heck that gets re-routed to the external mount

DerGenaue avatar Mar 29 '23 21:03 DerGenaue

ok, I now see why you think the issue might lie in https://github.com/nextcloud/server/commits/master/lib/private/Files/Config/UserMountCache.php

EDIT: This is probably not the underlying issue

I was able to trace the issue to this function: https://github.com/nextcloud/server/blob/fc371facd202d7ede86f1adb37fc78a8c478deff/lib/private/Files/Config/UserMountCache.php#L340-L358

In here, in my case, the query returns two elements: the home mount (correct) and the external mount (not correct). I think this is the case because the folder I'm inspecting right now is both:

  • shared to internal users (this creates a mounting point for the other user)
  • shared to external users via a link

still investigating...

DerGenaue avatar Mar 29 '23 22:03 DerGenaue

I think I see it now...

In the DB table mounts, all my exernal mounts have the same value in the columns mount_id and storage_id

this by coincidence overlaps with the storage_id of my main storage which leads Nextcloud to think it can find the files over there...

This also explains why all your main storage was truncated when you deleted the mount: This function grabs the storage_id for the given mount_id and cleans up everything related to it: https://github.com/nextcloud/server/blob/fc371facd202d7ede86f1adb37fc78a8c478deff/lib/private/Files/Cache/Storage.php#L222-L255

I'm going to investigate some backups to see if this has been introduced by the upgrade to version 26

DerGenaue avatar Mar 29 '23 23:03 DerGenaue

Interesting... If I manually adjust the storage_id to the correct value, the shares and links work one time and then the value in the DB is changed back to the wrong one and the links are broken again...

DerGenaue avatar Mar 30 '23 00:03 DerGenaue

Ok, I was able to verify in a DB backup that the storage_id field used to contain the numeric_id from the storages table that related to this mount, while now it is just mirrors the mount_id for some reason. I'll create a new issue for this to express the significance of the problem that causes this and probably also a bunch of other issues.

DerGenaue avatar Mar 30 '23 00:03 DerGenaue

Here a warning to all of us that enabled ServerSide-Encryption: disabling my external FTP-Storage changed the sotrage_id of the home-drive in database and lead to a resync of all of my files to all connected machines. Obviously this storage_id/mount_id-bug disabled the recognition that the files on my Nextcloud-drive were encrypted using ServerSide-encryption. All of my files on the remote-clients had been overwritten with the encrypted files... Luckily, I did a fresh Backup of all of my files - so I'm fine - but be carful out there when larger directorys are syncing without reason!

xn--nding-jua avatar Mar 30 '23 20:03 xn--nding-jua

Nextcloud updated to v26 this morning and my external mounts broke. Just found this.

Do we have any progress or fixes for this?

mediacrave avatar Apr 06 '23 17:04 mediacrave

For now, the only way to get the external-mounts back to work is to use the "Administrator"-panel instead of the "User"-panel in the Nextcloud-settings. User-space mounts are not working at least for SMB/CIFS- and FTP-mounts. We are waiting for a reacting in this issue here: https://github.com/nextcloud/server/issues/37473

After migrating to the Administrator-space-mounts you will lose all shares. You have to recreate them and - if nescessary - rename the tokens with the ShareRenamer-App from https://apps.nextcloud.com/apps/sharerenamer

xn--nding-jua avatar Apr 06 '23 19:04 xn--nding-jua

Looks like 26.0.1 did fix it

waja avatar Apr 20 '23 11:04 waja

@waja Did it also fix the wrong ids in the database?

bobvandevijver avatar Apr 20 '23 11:04 bobvandevijver

I did not investigate this, but as 26.0.1 was deployed in the affected setup and users reported that the issue went away, I thought it would be good to report it here too.

waja avatar Apr 20 '23 11:04 waja

Looks like 26.0.1 did fix it

No it didn't, the problem still occure today even after the update. :/

SofianeLasri avatar Apr 20 '23 13:04 SofianeLasri

So we are just lucky? Hmm ... the external (smb) storages are mounted and I can download files there ...

waja avatar Apr 20 '23 13:04 waja

We can download files but not share them.

https://user-images.githubusercontent.com/43948827/233390797-d0fe1d16-c4c3-4e4d-8502-850006b8b76b.mp4

SofianeLasri avatar Apr 20 '23 14:04 SofianeLasri

But is this related to the reported issue?

waja avatar Apr 20 '23 15:04 waja

Yes, this issue is explicitly regarding creating share links. Downloads were never impacted.

bobvandevijver avatar Apr 20 '23 15:04 bobvandevijver

Oh, update.

I have found a workaround for myself.

If you create the share not in the "User" area but "Admin" area (and make it available to the users), everything works. More specifically: Administration settings -> Administration -> External Storage (don't forget to enable "allow share")

thanks man, you've rescued me today.

I have exactly the same issue on my instance running 26.0.1 on PHP8.1

serpentes80 avatar Apr 21 '23 17:04 serpentes80

Oh, update.

I have found a workaround for myself.

If you create the share not in the "User" area but "Admin" area (and make it available to the users), everything works. More specifically: Administration settings -> Administration -> External Storage (don't forget to enable "allow share")

I got hit with the same issue after upgrading my instance to 26.0.1 as well, although I found it in slightly different way. In my case I could edit Draw.io and OnlyOffice docs on internal storage, but not on SMB mounted external storage. Moving the SMB shares from Personal settings to Administrative settings allows editing from these two add-ons to work again.

Thanks much!

alankeny avatar Apr 22 '23 22:04 alankeny

Moving the SMB shares from Personal settings to Administrative settings allows editing from these two add-ons to work again.

Be careful with this. "Moving" an external storage might add further harm, like broken Shares for other users of your instance. See https://github.com/nextcloud/server/issues/37473#issuecomment-1518529756.

XueSheng-GIT avatar Apr 23 '23 04:04 XueSheng-GIT

I just found another symptom (maybe), which involves the audio player addon. The audio files for it come from an external storage and cannot be played back anymore. Furthermore they dissapear from the player all together. They appear after a rescan but are still not functional afterward. Is it possible that it is related to this?

efelon avatar Apr 26 '23 09:04 efelon

I have the same issue unfortunately. I am on 26.0.1

Lipown avatar May 02 '23 09:05 Lipown