occ files_external:notify does not propogate changes to clients.
Steps to reproduce
- Mount a windows share in nextcloud
- Let a desktop client sync the share.
- Run occ files_external:notify -v <mount_id>
- Make some changes remote, directly to the windows share by other means.
Expected behaviour
The desktop clients should propogate the changes that happened directly to the SMB share.
Actual behaviour
I get the changes listed out in the terminal output of the occ files_external:notify command, but nothing else happens.
Server configuration
Operating system: Ubuntu Server 16.04 Web server: Nginx 1.10
Database: Mariadb 10 PHP version: 7.0/7.1 (tried both) Nextcloud version: (see Nextcloud admin page) 11.0.1 and 11.0.2 (tried both)
Updated from an older Nextcloud/ownCloud or fresh install: Upgrade. Where did you install Nextcloud from: Wonderfall/nextcloud:latest
Client configuration
Operating system: Elementary with nextcloud-client 2.2.4
@icewind1991
I have the same issue. Any idea to fix it ?
Update : I can not see the reference of the new file in the table oc_filecache
This issue is a major problem for us because file change by a local SMB Share are not propagate to the nextcloud client. We can help you to fix this issue if we can understand how the sync process works and how the SMB notify works in Nextcloud.
@icewind1991
up ?
I'm working on this issue, and I have a question. In apps\files_external\lib\Command\Notify.php, I can found the function that it call by the notify command. In the execute function (at line 90), I can found only the request to update a files already register in file_cache table, but no method to add or remove files....
If I understand the process correctly, another issue is possible. External_Storage are register as mount point in oc_mounts. Each user that use an external storage refer it by a storage id. The storage id is use to refer the file in oc_filecache.
So, if a user push a file (from web ou client), it is refer in his storage, but all other are not updated ...
Anyone could explained how NextCloud get file data to store it in the filecache table? especially mimetype list, mimepart, etag, permissions
The notify command doesn't write the new info to the filecache itself.
It marks a folder as out-of-date (setting it's size to -1), the background scanner (cron) will then detect that and handle updating the cache.
If you're running into issues with the cache not being updated while the notify command works fine, please verify that nextcloud's cron job is running correctly
So notify works only if a file or folder is changed, what's happen if we add a file ? In addition, scan must have the credential to access to the share especially if we use credential session (ldap user).
For new files the folder is also marked as outdated and the scanner will find the new files.
session credentials might indeed cause issues, not sure, will investigate later
If we use the session credential, scan can occur only if the user is connected to the web interface. It could be interresting to allow scan when the user is connected throw the windows client (could be an option to enable in the admin panel).
If I correctly understand, the windows client use WebDAV to connect with NextCloud. it could be interresting to invoque the cron (like ajax cron) when a user log on by Nextcloud client.
is it possible to run two cron jobs? one every minute that only for checking if a folder has been marked as updated? and the other for everything else. I have my cron time set to 15min, so it takes up to 15 minutes before a change is synced.
I think you can not solve this problem with two cron. Your second job need to have the user credential store somewhere. If (like me) you used the credential in the session, NextCloud don't have the login/password to connect to the remote share.
Multiple parallel cron jobs are supported since NC 10 I think
Up ?
I think that the best way to fix this issue is to create a "new" way to scan the files. A scan method, running with a remote account can read permissions on the remote share and associate it with nextcloud user ... (LDAP Account).
Is it possible to have informations about the file_cache table (column description and waiting values)
I think a problem exist with the markParentAsOutdated function because it use dirname() php method. under Windows, this method use / and \ to parse the directory, but under Linux it use only /. So when Nextcloud is running under linux and check a Windows path, the parent directory is not correctly parse ...