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]: File sharing on External Storage isn't working anymore since NC 26 upgrade (PHP 8.2) #37414

Closed
6 of 9 tasks
Tracked by #1846 ...
SofianeLasri opened this issue Mar 26, 2023 · 31 comments · Fixed by #38115
Closed
6 of 9 tasks
Tracked by #1846 ...
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 26-feedback bug

Comments

@SofianeLasri
Copy link

⚠️ 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.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • 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?

  • 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 SofianeLasri added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Mar 26, 2023
@SubZero84
Copy link

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
Copy link

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

@xn--nding-jua
Copy link

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
Copy link

xn--nding-jua commented Mar 29, 2023

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
Copy link

xn--nding-jua commented Mar 29, 2023

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}

@DerGenaue
Copy link
Contributor

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

@xn--nding-jua
Copy link

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

@DerGenaue
Copy link
Contributor

DerGenaue commented Mar 29, 2023

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

@xn--nding-jua
Copy link

Maybe problem is related to issue #21049
But obviously something has changed between NC25 and NC26

@DerGenaue
Copy link
Contributor

DerGenaue commented Mar 29, 2023

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
Copy link
Contributor

DerGenaue commented Mar 29, 2023

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:

public function getMountsForFileId($fileId, $user = null) {
try {
[$storageId, $internalPath] = $this->getCacheInfoFromFileId($fileId);
} catch (NotFoundException $e) {
return [];
}
$builder = $this->connection->getQueryBuilder();
$query = $builder->select('storage_id', 'root_id', 'user_id', 'mount_point', 'mount_id', 'f.path', 'mount_provider_class')
->from('mounts', 'm')
->innerJoin('m', 'filecache', 'f', $builder->expr()->eq('m.root_id', 'f.fileid'))
->where($builder->expr()->eq('storage_id', $builder->createPositionalParameter($storageId, IQueryBuilder::PARAM_INT)));
if ($user) {
$query->andWhere($builder->expr()->eq('user_id', $builder->createPositionalParameter($user)));
}
$result = $query->execute();
$rows = $result->fetchAll();
$result->closeCursor();

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
Copy link
Contributor

DerGenaue commented Mar 29, 2023

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:

public static function cleanByMountId(int $mountId) {
$db = \OC::$server->getDatabaseConnection();
try {
$db->beginTransaction();
$query = $db->getQueryBuilder();
$query->select('storage_id')
->from('mounts')
->where($query->expr()->eq('mount_id', $query->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
$storageIds = $query->executeQuery()->fetchAll(\PDO::FETCH_COLUMN);
$storageIds = array_unique($storageIds);
$query = $db->getQueryBuilder();
$query->delete('filecache')
->where($query->expr()->in('storage', $query->createNamedParameter($storageIds, IQueryBuilder::PARAM_INT_ARRAY)));
$query->executeStatement();
$query = $db->getQueryBuilder();
$query->delete('storages')
->where($query->expr()->in('numeric_id', $query->createNamedParameter($storageIds, IQueryBuilder::PARAM_INT_ARRAY)));
$query->executeStatement();
$query = $db->getQueryBuilder();
$query->delete('mounts')
->where($query->expr()->eq('mount_id', $query->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
$query->executeStatement();
$db->commit();
} catch (\Exception $e) {
$db->rollBack();
throw $e;
}
}

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

@DerGenaue
Copy link
Contributor

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
Copy link
Contributor

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.

@xn--nding-jua
Copy link

xn--nding-jua commented Mar 30, 2023

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!

@mediacrave
Copy link

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

Do we have any progress or fixes for this?

@xn--nding-jua
Copy link

xn--nding-jua commented Apr 6, 2023

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: #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

@waja
Copy link

waja commented Apr 20, 2023

Looks like 26.0.1 did fix it

@bobvandevijver
Copy link

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

@waja
Copy link

waja commented Apr 20, 2023

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.

@SofianeLasri
Copy link
Author

Looks like 26.0.1 did fix it

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

@waja
Copy link

waja commented Apr 20, 2023

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

@SofianeLasri
Copy link
Author

We can download files but not share them.

Desktop.20-04-2023.16-02-25.mp4

@waja
Copy link

waja commented Apr 20, 2023

But is this related to the reported issue?

@bobvandevijver
Copy link

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

@serpentes80
Copy link

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

@alankeny
Copy link

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!

@XueSheng-GIT
Copy link

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 #37473 (comment).

@efelon
Copy link

efelon commented Apr 26, 2023

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?

@Lipown
Copy link

Lipown commented May 2, 2023

I have the same issue unfortunately. I am on 26.0.1

@majneb
Copy link

majneb commented May 3, 2023

Same error "Error while creating the share" here when clicking on "share link", either with external S3 storage or with local files or folders.
With local files, after reloading the page and going to the share panel I can see the share link. The link is working but when trying to download the file from this link, I get an error : "page not found on the server".
With files from the S3 storage, reloading the page and going to the share panel, there is no link shown.

Should I create another issue as it also affects local files and folders ?

(fresh nextcloud 26.0.1 / php8.1 / MariaDB manual install)

EDIT : When mounting the S3 external storage from the admin set-up page and not from the user set-up page, the problem is gone for both local and external files/folders.
When mounting an external storage from the admin set-up page you can specify which users can access it, so for small instances this solution can be a workaround. But of course this does not solve the problem for those who wants the users to be able to mount their own storage and share it.

DerGenaue added a commit to DerGenaue/server that referenced this issue May 7, 2023
…unt.php

so that it doesn't override `numericStorageId` in the `MountPoint` baseclass

fixes nextcloud#37473
fixes nextcloud#37414

Signed-off-by: Daniel <7558512+DerGenaue@users.noreply.github.com>
backportbot-nextcloud bot pushed a commit that referenced this issue May 16, 2023
…unt.php

so that it doesn't override `numericStorageId` in the `MountPoint` baseclass

fixes #37473
fixes #37414

Signed-off-by: Daniel <7558512+DerGenaue@users.noreply.github.com>
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 26-feedback bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.