nextcloud / groupfolders

📁👩‍👩‍👧‍👦 Admin-configured folders shared by everyone in a group. https://github.com/nextcloud-releases/groupfolders
https://apps.nextcloud.com/apps/groupfolders
281 stars 85 forks source link

[Bug]: Auto-expiry of shared folder inside group folder leads to Files app not working anymore for user #2143

Open JMoVS opened 2 years ago

JMoVS commented 2 years ago

⚠️ This issue respects the following points: ⚠️

Bug description

We have a group folder ("DirA") to which User A has access using the group folder permissions. On a subdirectory (let's call it "DirA/B"), User A doesn't have access as the group folder permissions on that subdirectory don't allow access. However, we then give access to the subdirectory of this non-shared folder via the nextcloud sharing option for internal users, so to say to "DirA/B/X".

The bug is that when the nextcloud sharing expires on the directory X, the whole files app stops working and instead only returns an "internal server error" all the time, until someone reshared directory X with the User. If the share is manually removed, the bug doesn't occur. Only on auto-expiration based on the date, there's this issue.

Steps to reproduce

  1. Setup a group folder, give advanced permissions to a User A
  2. Set up a subdirectory of the group folder, to which using the advanced permissions, User A has no rights
  3. Create another subdirectory in this directory that is hidden to User A and use the sharing panel to enter the User A name and share
  4. Set an expiration date
  5. At expiry, the user will have problems using the files app until the folder is shared in the sharing panel again.

Expected behavior

Auto-expiry of shares should not lead to Files app not working anymore

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

No response

Web server

No response

Database engine version

No response

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

No response

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nowhereland.phelas.com",
            "nextcloud-app"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.5.1",
        "overwrite.cli.url": "https:\/\/nowhereland.phelas.com",
        "overwriteprotocol": "https",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "data-fingerprint": "3737cb51804a03a7f06c823eb9ba0d10",
        "maintenance": false,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "session_lifetime": 14400,
        "theme": "",
        "loglevel": "1",
        "default_phone_region": "DE",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "LiquairStore"
        ],
        "twofactor_enforced_excluded_groups": [],
        "enable_previews": false,
        "allow_local_remote_servers": "true",
        "log_type": "file",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED",
            "HTTP_FORWARDED_FOR"
        ]
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - appointments: 1.12.8
  - apporder: 0.15.0
  - bruteforcesettings: 2.4.0
  - calendar: 3.5.0
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.2.1
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - external: 4.0.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_accesscontrol: 1.14.1
  - files_automatedtagging: 1.14.0
  - files_downloadactivity: 1.13.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
  - forms: 2.5.1
  - groupfolders: 12.0.1
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - mail: 1.13.8
  - nextcloud_announcements: 1.13.0
  - notes: 4.5.1
  - notifications: 2.12.1
  - oauth2: 1.12.0
  - onlyoffice: 7.5.4
  - password_policy: 1.14.0
  - polls: 3.8.1
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - ransomware_protection: 1.13.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - tasks: 0.14.4
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_nextcloud_notification: 3.4.0
  - twofactor_totp: 6.4.0
  - twofactor_webauthn: 0.3.2
  - updatenotification: 1.14.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - encryption
  - integration_whiteboard: 0.0.14
  - photos: 1.1.0
  - support: 1.4.0
  - twofactor_admin: 3.2.0
  - unsplash: 1.2.5
  - user_ldap
  - user_status: 1.0.1

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

CarlSchwan commented 1 year ago

Do you have some logs?

JMoVS commented 1 year ago

which logs are you specifically looking for? Normal server logs?

JMoVS commented 1 year ago

this is what is shown then in the logs:

{"reqId":"HjIHsLFPRA8eDcTm9Cmm","level":4,"time":"2022-10-20T07:09:26+00:00","remoteAddr":"<remoteIPredacted>","user":"UserA","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/UserA/","message":"OCP\\Files\\NotFoundException: /Groupfolderroot/Company Strategy/Internal/People/Employees/Interns/USERB not found while trying to get owner","userAgent":"Mozilla/5.0 (Windows) mirall/3.6.0stable-Win64 (build 20220906) (Nextcloud, windows-10.0.19043 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"24.0.6.1","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"OCP\\Files\\NotFoundException: /Groupfolderroot/Company Strategy/Internal/People/Employees/Interns/USERB not found while trying to get owner","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":180,"function":"check","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":135,"function":"check","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMethod:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":358,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":166,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/apps/dav/lib/Connector/Sabre/Auth.php","Line":161,"CustomMessage":"--"},"id":"6350f58036d6e"}

{"reqId":"HjIHsLFPRA8eDcTm9Cmm","level":3,"time":"2022-10-20T07:09:26+00:00","remoteAddr":"<remoteIPredacted>","user":"UserA","app":"no app in context","method":"PROPFIND","url":"/remote.php/dav/files/UserA/","message":"/Groupfolderroot/Company Strategy/Internal/People/Employees/Interns/USERB not found while trying to get owner","userAgent":"Mozilla/5.0 (Windows) mirall/3.6.0stable-Win64 (build 20220906) (Nextcloud, windows-10.0.19043 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"24.0.6.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/Groupfolderroot/Company Strategy/Internal/People/Employees/Interns/USERB not found while trying to get owner","Code":0,"Trace":[{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":1128,"function":"getOwner","class":"OC\\Files\\View","type":"->","args":["/Groupfolderroot/Company Strategy/Internal/People/Employees/Interns/USERB"]},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":892,"function":"shareNotificationForOriginalOwners","class":"OCA\\Activity\\FilesHooks","type":"->","args":["*** sensitive parameters replaced ***","self_unshared_by","*** sensitive parameters replaced ***",387047,"folder"]},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":849,"function":"selfUnshareFromUser","class":"OCA\\Activity\\FilesHooks","type":"->","args":[{"__class__":"OC\\Share20\\Share"}]},{"file":"/var/www/html/apps/activity/lib/FilesHooks.php","line":816,"function":"unshareFromUser","class":"OCA\\Activity\\FilesHooks","type":"->","args":[{"__class__":"OC\\Share20\\Share"}]},{"file":"/var/www/html/apps/activity/lib/FilesHooksStatic.php","line":105,"function":"unShare","class":"OCA\\Activity\\FilesHooks","type":"->","args":[{"__class__":"OC\\Share20\\Share"}]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":264,"function":"unShare","class":"OCA\\Activity\\FilesHooksStatic","type":"::","args":[{"__class__":"OC\\EventDispatcher\\GenericEventWrapper"},"OCP\\Share::preUnshare",{"__class__":"Symfony\\Component\\EventDispatcher\\EventDispatcher"}]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":239,"function":"doDispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[[{"__class__":"Closure"},{"__class__":"Closure"}],"OCP\\Share::preUnshare",{"__class__":"OC\\EventDispatcher\\GenericEventWrapper"}]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[[{"__class__":"Closure"},{"__class__":"Closure"}],"OCP\\Share::preUnshare",{"__class__":"OC\\EventDispatcher\\GenericEventWrapper"}]},{"file":"/var/www/html/lib/private/EventDispatcher/SymfonyAdapter.php","line":122,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[{"__class__":"OC\\EventDispatcher\\GenericEventWrapper"},"OCP\\Share::preUnshare"]},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1232,"function":"dispatch","class":"OC\\EventDispatcher\\SymfonyAdapter","type":"->","args":["OCP\\Share::preUnshare",{"__class__":"Symfony\\Component\\EventDispatcher\\GenericEvent"}]},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1556,"function":"deleteShare","class":"OC\\Share20\\Manager","type":"->","args":[{"__class__":"OC\\Share20\\Share"}]},{"file":"/var/www/html/lib/private/Share20/Manager.php","line":1411,"function":"checkExpireDate","class":"OC\\Share20\\Manager","type":"->","args":[{"__class__":"OC\\Share20\\Share"}]},{"file":"/var/www/html/apps/files_sharing/lib/MountProvider.php","line":95,"function":"getSharedWith","class":"OC\\Share20\\Manager","type":"->","args":["*** sensitive parameters replaced ***",0,null,-1]},{"file":"/var/www/html/lib/private/Files/Config/MountProviderCollection.php","line":134,"function":"getMountsForUser","class":"OCA\\Files_Sharing\\MountProvider","type":"->","args":[{"__class__":"OC\\User\\User"},{"__class__":"OC\\Files\\Storage\\StorageFactory"}]},{"file":"/var/www/html/lib/private/Files/SetupManager.php","line":225,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->","args":[{"__class__":"OC\\User\\User"},{"__class__":"OC\\Files\\Mount\\Manager"},{"__class__":"Closure"}]},{"file":"/var/www/html/lib/private/Files/SetupManager.php","line":317,"function":"OC\\Files\\{closure}","class":"OC\\Files\\SetupManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Files/SetupManager.php","line":226,"function":"setupForUserWith","class":"OC\\Files\\SetupManager","type":"->","args":[{"__class__":"OC\\User\\User"},{"__class__":"Closure"}]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":111,"function":"setupForUser","class":"OC\\Files\\SetupManager","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Auth.php","line":123,"function":"setupFS","class":"OC_Util","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php","line":103,"function":"validateUserPass","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Auth.php","line":251,"function":"check","class":"Sabre\\DAV\\Auth\\Backend\\AbstractBasic","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Auth.php","line":154,"function":"auth","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":180,"function":"check","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":135,"function":"check","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMethod:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":358,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":166,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Files/View.php","Line":1698,"CustomMessage":"--"},"id":"6350f58036f81"}