Skip to content

Accessing share from external storage doesn't check for changes #23539

@kevinkk525

Description

@kevinkk525

Description

Accessing a share from external storage doesn't check for changes on the external storage so if it got modified, the user accessing a share (not the external storage directly) will never see those changes. Only once the original user who mounted the external storage checks that directoy he shared, then the share will be updated for all users.
This is a problem that apprently exists since at least 4 years so I'm surprised nobody fixed it yet: https://www.reddit.com/r/NextCloud/comments/54warq/problems_with_nextclouds_external_storage/

Context for usage: I want to have a big s3 storage in a remote location that one user/organization mounts and then distributes shares to different members. Since every member/group will have different access rights and doesn't need everything from the storage, mounting the whole storage for all users/groups is not possible. Creating a nextcloud group/circle for every access type and then assigning every member/group to those access groups which each get a mount to their specific folder on the external storage might be a workaround but a pretty ugly one that is also only possible for the admin as those mounts assigned to groups are admin mounts. So no normal user could do that.

Steps to reproduce

  1. User A mounts external storage e.g. S3 (which is what I tested), with check for changes: on every direct access
  2. User A shares directory Test which is inside the external storage with User B
  3. User B accesses the share and it looks fine
  4. An external instance modifies the contents of directory Test (e.g. through minio web interface
  5. User B refreshes the share, modifications not visible
  6. User A refreshes the page/share, modifications visible
  7. User B now sees the modifications too.

Edit/Addendum: If the directoy Test is additionally shared by link from User A, then accessing it by that link will check the external storage on every access and therefore all modifications are always visible when using the link. This is the expected behaviour actually and I was surprised to discover that it works correctly with shared links but not with shares to users.

Expected behaviour

Check the external storage for changes on every access by a share.

Actual behaviour

External storage is only checked for changes if the user who has mounted it is checking it or by accessing a shared link.

Server configuration

Operating system: Ubuntu 18.04

Web server: nginx

Database: sqlite

PHP version: 7.4.11

Nextcloud version: (see Nextcloud admin page) 20.0.0

Updated from an older Nextcloud/ownCloud or fresh install: fresh

Where did you install Nextcloud from: web-installer, standard installation without any changes

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: no

Are you using an external user-backend, if yes which one: S3 minio

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions