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

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

Closed
kevinkk525 opened this issue Oct 17, 2020 · 8 comments
Closed

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

kevinkk525 opened this issue Oct 17, 2020 · 8 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@kevinkk525
Copy link

kevinkk525 commented Oct 17, 2020

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

@kevinkk525 kevinkk525 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Oct 17, 2020
@garblixa
Copy link

garblixa commented Oct 20, 2020

I don't have the same setup and testing scenario, but I notice the same error that the directory with the external drive is not updated when changes are made outside of nextcloud.

Strangely enough, this is not the case with all SMB shares.

sudo -u www-data php occ files_external:list

| 1        | /10_Tausch_meine_Projekte   | SMB / CIFS | Log-in credentials, save in database | host: "10.0.0.1", share: "default-school", root: "share\/projects", domain: "FZI", show_hidden: false, check_acl: false, timeout: "" |                      | All 
...
| 4        | /10_Tausch_meine_Klassen    | SMB / CIFS | Log-in credentials, save in database | host: "10.0.0.1", share: "default-school", root: "share\/classes", domain: "FZI", show_hidden: false, check_acl: false, timeout: ""  |                      | All  

The share with the ID 1 is always updated when accessed. But not the share with ID 4.

If a folder in share 4 on the Samba file server is removed, it will remain visible in nextcloud when accessed again. But this will result in an error message that the file/folder does not exist. Nevertheless the folder remains in Nextcloud.

Only the command sudo -u www-data php occ files:scan --all updates share ID 4.

Maybe this is related to your bug report.

@kevinkk525
Copy link
Author

If a folder in share 4 on the Samba file server is removed, it will remain visible in nextcloud when accessed again.

If by that you mean it is still visible for the user that mounted the smb share, then this is not the same issue I'm talking about.

In my case all changes are visible to the user that mounted the (s3) share because nextcloud checks for changes on this direct access. But if that users shares a folder from that mount with another user, that share will never get updated unless the original user checks the directory.

@garblixa
Copy link

The shares in my case are globally mounted shares, configured with an admin account.

@kevinkk525
Copy link
Author

kevinkk525 commented Oct 20, 2020

Then every user has a direct access to that mounted storage. Therefore it works for all your users and is not what this issue is about.

@kevinkk525
Copy link
Author

Anyone interested in fixing this?

@cheneraie
Copy link

cheneraie commented Jan 11, 2021

I have same behavior with SMB/CIFS external storage :

  1. User A mounts SMB external storage and names it FOLDER_A, with credentials stored in database and check for changes on every direct access
  2. User A shares directory FOLDER_A with User B
  3. User B accesses the share and it looks fine
  4. An external instance modifies the contents of directory FOLDER_A (directly on the windows server file system)
  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.

With Nextloud 19.0.6, I did not get the same behavior, it worked very well. This appeared after upgrade 19.0.6 → 20.0.4

@kevinkk525
Copy link
Author

Thanks for the confirmation!
Sadly this seems to be another issue the nextcloud devs just keep ignoring.. Maybe we'll get lucky eventually..

@szaimen
Copy link
Contributor

szaimen commented Jun 22, 2021

Duplicate of #23988

@szaimen szaimen marked this as a duplicate of #23988 Jun 22, 2021
@szaimen szaimen closed this as completed Jun 22, 2021
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 bug
Projects
None yet
Development

No branches or pull requests

4 participants