Skip to content

[Bug]: Changes to files within directory shared by federation do not sync to other users #42529

Open
@raxod502

Description

⚠️ This issue respects the following points: ⚠️

Bug description

When sharing a folder (not an individual file) with another user that is on a different Nextcloud instance (so sharing via federation), and editing a file within the shared folder, then the edits from other users are synced to the owning user, but the edits from the owning user are not synced to the other users.

Steps to reproduce

  1. Setup two Nextcloud instances on different domains (I created two on PikaPods for testing). Call them Owner and Guest.
  2. On the Owner instance, create a new folder and add the admin account on the Guest instance as a user with read/write access to the new folder (using federated sharing, i.e. Share with (remote)).
  3. On the Guest instance, go to the notifications dropdown in the menu bar to accept the incoming directory share
  4. On the Owner instance, create a new text file in the shared folder. This should show up in the Guest instance too
  5. Open the text file in both Owner and Guest instances
  6. On the Guest instance, add some text to the file and click save. Go back to the Owner instance, there should be a popup notifying that the file has changed outside the editor. Accept the changes, you should see the changes from the Guest instance
  7. Try the other way around. On the Owner instance, add some more text to the file and click save. Go back to the Guest instance, there is no popup notifying about changes. Even refreshing the page does not cause the changes from the Owner instance to show up.
  8. Go back to the Owner instance after refreshing the page on the Guest instance. Now there is a popup on the Owner instance asking to revert the recently added text, as if the Guest instance not only didn't realize the Owner instance had made changes, but silently overwrote them back!

Note: this bug does not occur when sharing a file locally, it only happens with federation. It also does not occur when sharing a file directly, it only happens when sharing a directory that contains the file.

Expected behavior

Behavior should be symmetric whether the owner of a file in a shared directory edits it, or whether someone with whom it is shared edits it.

Installation method

Community Docker image

Nextcloud Server version

28

Operating system

Other

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MySQL

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

Fresh Nextcloud Server install

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

{
    "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
        }
    ],
    "overwritehost": "raxod502-nextcloud1.pikapod.net",
    "overwriteprotocol": "https",
    "overwrite.cli.url": "https:\/\/raxod502-nextcloud1.pikapod.net\/",
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "upgrade.disable-web": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "raxod502-nextcloud1.pikapod.net"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "28.0.1.1",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true
}

List of activated Apps

Enabled:
 - activity: 2.20.0
 - calendar: 4.6.1
 - circles: 28.0.0-dev
 - cloud_federation_api: 1.11.0
 - comments: 1.18.0
 - contacts: 5.5.0
 - contactsinteraction: 1.9.0
 - dashboard: 7.8.0
 - dav: 1.29.1
 - federatedfilesharing: 1.18.0
 - federation: 1.18.0
 - files: 2.0.0
 - files_pdfviewer: 2.9.0
 - files_reminders: 1.1.0
 - files_sharing: 1.20.0
 - files_trashbin: 1.18.0
 - files_versions: 1.21.0
 - firstrunwizard: 2.17.0
 - logreader: 2.13.0
 - lookup_server_connector: 1.16.0
 - mail: 3.5.0
 - nextcloud_announcements: 1.17.0
 - notes: 4.9.2
 - notifications: 2.16.0
 - oauth2: 1.16.3
 - password_policy: 1.18.0
 - photos: 2.4.0
 - privacy: 1.12.0
 - provisioning_api: 1.18.0
 - recommendations: 2.0.0
 - related_resources: 1.3.0
 - richdocuments: 8.3.0
 - richdocumentscode: 23.5.604
 - serverinfo: 1.18.0
 - settings: 1.10.1
 - sharebymail: 1.18.0
 - spreed: 18.0.1
 - support: 1.11.0
 - survey_client: 1.16.0
 - systemtags: 1.18.0
 - text: 3.9.1
 - theming: 2.3.0
 - twofactor_backupcodes: 1.17.0
 - updatenotification: 1.18.0
 - user_status: 1.8.1
 - viewer: 2.2.0
 - weather_status: 1.8.0
 - workflowengine: 2.10.0
Disabled:
 - admin_audit
 - bruteforcesettings
 - encryption
 - files_external
 - suspicious_login
 - twofactor_totp
 - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"CcZG2QILoVQPwzzfKgNp","level":3,"time":"2023-12-29T20:05:02+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Exception thrown: Exception","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":709,"function":"checkInstalled","class":"OC","type":"::","args":[["OC\\SystemConfig"]]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":43,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"Exception thrown: Exception"}}
{"reqId":"9ggyoqpmziIZCvoYkwfx","level":3,"time":"2023-12-29T20:10:02+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Exception thrown: Exception","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":709,"function":"checkInstalled","class":"OC","type":"::","args":[["OC\\SystemConfig"]]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/cron.php","line":43,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/base.php","Line":283,"CustomMessage":"Exception thrown: Exception"}}
{"reqId":"h4C0w7nvj73v4rg6gGQG","level":3,"time":"2023-12-29T20:13:14+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"index","method":"GET","url":"/apps/theming/favicon?v=21421e36","message":"Could not create folder \"/appdata_oc90a8qqtjs3/theming/global\"","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder \"/appdata_oc90a8qqtjs3/theming/global\"","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":147,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->","args":["global"]},{"file":"/var/www/html/apps/theming/lib/ImageManager.php","line":367,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["global"]},{"file":"/var/www/html/apps/theming/lib/ImageManager.php","line":101,"function":"getRootFolder","class":"OCA\\Theming\\ImageManager","type":"->","args":[]},{"file":"/var/www/html/apps/theming/lib/Controller/IconController.php","line":127,"function":"getImage","class":"OCA\\Theming\\ImageManager","type":"->","args":["favicon",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getFavicon","class":"OCA\\Theming\\Controller\\IconController","type":"->","args":["core"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Theming\\Controller\\IconController"],"getFavicon"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Theming\\Controller\\IconController"],"getFavicon"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Theming\\Controller\\IconController","getFavicon",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["core","theming.Icon.getFavicon"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/theming/favicon"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/Node/Folder.php","Line":162,"message":"Could not create folder \"/appdata_oc90a8qqtjs3/theming/global\"","exception":{},"CustomMessage":"Could not create folder \"/appdata_oc90a8qqtjs3/theming/global\""}}
{"reqId":"3OpHiNUjZmg8LY1YfCES","level":4,"time":"2023-12-29T20:16:10+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"no app in context","method":"POST","url":"/settings/apps/enable","message":"Could not boot richdocuments: Call to undefined method OCA\\Richdocuments\\Service\\DiscoveryService::refetch()","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OCA\\Richdocuments\\Service\\DiscoveryService::refetch()","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/richdocuments/lib/AppInfo/Application.php","line":154,"function":"checkAndEnableCODEServer","class":"OCA\\Richdocuments\\AppInfo\\Application","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Richdocuments\\AppInfo\\Application","type":"->","args":[["OC\\AppFramework\\Bootstrap\\BootContext"]]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["richdocuments"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":136,"function":"loadApp","class":"OC\\App\\AppManager","type":"->","args":["richdocuments"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":821,"function":"loadApp","class":"OC_App","type":"::","args":["richdocuments"]},{"file":"/var/www/html/lib/private/Installer.php","line":166,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["richdocuments",["OCA\\Richdocuments\\Migration\\InstallDefaultFonts"]]},{"file":"/var/www/html/apps/settings/lib/Controller/AppSettingsController.php","line":454,"function":"installApp","class":"OC\\Installer","type":"->","args":["richdocuments"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"enableApps","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":[["richdocuments"],[]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\AppSettingsController"],"enableApps"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Settings\\Controller\\AppSettingsController"],"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\AppSettingsController","enableApps",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["settings.AppSettings.enableApps"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/apps/enable"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/richdocuments/lib/AppInfo/Application.php","Line":226,"message":"Could not boot richdocuments: Call to undefined method OCA\\Richdocuments\\Service\\DiscoveryService::refetch()","exception":{},"CustomMessage":"Could not boot richdocuments: Call to undefined method OCA\\Richdocuments\\Service\\DiscoveryService::refetch()"}}
{"reqId":"3OpHiNUjZmg8LY1YfCES","level":3,"time":"2023-12-29T20:16:10+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"imagettftext(): Could not read font at /var/www/html/custom_apps/richdocuments/lib/Service/FontService.php#228","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","data":{"app":"PHP"}}
{"reqId":"3OpHiNUjZmg8LY1YfCES","level":3,"time":"2023-12-29T20:16:10+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"imagettftext(): Could not read font at /var/www/html/custom_apps/richdocuments/lib/Service/FontService.php#228","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","data":{"app":"PHP"}}
{"reqId":"3OpHiNUjZmg8LY1YfCES","level":3,"time":"2023-12-29T20:16:10+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"PHP","method":"POST","url":"/settings/apps/enable","message":"imagettftext(): Could not read font at /var/www/html/custom_apps/richdocuments/lib/Service/FontService.php#228","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","data":{"app":"PHP"}}
{"reqId":"lJKXojgdQWeGimpFI7ft","level":3,"time":"2023-12-29T20:16:30+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"index","method":"GET","url":"/core/preview?fileId=9&x=256&y=256&c=e030db7fd55bcdf35961638a67a754bb","message":"Could not get appdata folder for preview","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"RuntimeException","Message":"Could not get appdata folder for preview","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":147,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/Storage/Root.php","line":74,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["4/5/c/4/8/c/c/9"]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":607,"function":"newFolder","class":"OC\\Preview\\Storage\\Root","type":"->","args":["9"]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":133,"function":"getPreviewFolder","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"]]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":110,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],[[256,256,true,"fill"]],"image/jpeg"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":187,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],256,256,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":173,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[["OC\\Files\\Node\\File"],256,256,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":141,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[["OC\\Files\\Node\\File"],256,256,false,true,"fill",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[9,256,256,false,true,"fill",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\PreviewController"],"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\PreviewController"],"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["core.Preview.getPreviewByFileId"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/AppData/AppData.php","Line":108,"message":"Could not get appdata folder for preview","exception":{},"CustomMessage":"Could not get appdata folder for preview"}}
{"reqId":"WiI4XaLVntgkqmbwGmyG","level":3,"time":"2023-12-29T20:16:30+00:00","remoteAddr":"2601:281:8000:3b:daaa:c5d9:db53:c69f","user":"admin","app":"index","method":"GET","url":"/core/preview?fileId=10&x=256&y=256&c=3164d787be81589b9b4d9aa363649842","message":"Could not get appdata folder for preview","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0","version":"28.0.1.1","exception":{"Exception":"RuntimeException","Message":"Could not get appdata folder for preview","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":147,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/var/www/html/lib/private/Preview/Storage/Root.php","line":74,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["d/3/d/9/4/4/6/10"]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":607,"function":"newFolder","class":"OC\\Preview\\Storage\\Root","type":"->","args":["10"]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":133,"function":"getPreviewFolder","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"]]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":110,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],[[256,256,true,"fill"]],"image/jpeg"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":187,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],256,256,true,"fill",null]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":173,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[["OC\\Files\\Node\\File"],256,256,true,"fill"]},{"file":"/var/www/html/core/Controller/PreviewController.php","line":141,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[["OC\\Files\\Node\\File"],256,256,false,true,"fill",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->","args":[10,256,256,false,true,"fill",false]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\PreviewController"],"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OC\\Core\\Controller\\PreviewController"],"getPreviewByFileId"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\PreviewController","getPreviewByFileId",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["core.Preview.getPreviewByFileId"]]},{"file":"/var/www/html/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/core/preview"]},{"file":"/var/www/html/index.php","line":39,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/AppData/AppData.php","Line":108,"message":"Could not get appdata folder for preview","exception":{},"CustomMessage":"Could not get appdata folder for preview"}}

Additional info

I've been testing with Nextcloud instances run on PikaPods, so I don't have access to the underlying operating system, just mysql database and filesystem access.

The logs and configuration data is from the Owner instance described in the reproduction steps above. I can provide data from the Guest instance as well, although these are both brand new servers created with default settings so it should be straightforward for others to reproduce the issue.

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions