External Storage local not syncing

Nextcloud version (eg, 12.0.2): 16.0.5
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04 Bionic
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.1): 7.2.19 Using php-fpm

The issue you are facing:
Installed Nextcloud on a new server. I mount local storage from the server. I am able to create the mount in Nextcloud web interface and allow myself access to it. It shows up in the Mac client (Version 2.3.3 (build 84)). and I check the box to sync it. Everything is pulled down and the directory is created on the client machine. If I add new items to that directory on the server, it is never rescanned and synced with the client. I realize that this can and should be set up as a cron job. However, the local shared directory is no longer created in my /data/user/files/ directory on the server. Thus there is no way to run a rescan. Even a sudo -u www-data php /var/www/nextcloud/occ files:scan --all will not work. As there is no directory under my user that corresponds with the mount, there is nothing there to scan so I can’t do a: sudo -u www-data php /var/www/nextcloud/occ files:scan --path="/username/files/local_share_dir" as local_share_dir does not exist.
I have checked permissions and they are -rw-r----- www-data:www-data so www-data can access the share just fine.
Now, if I add a new file on my client computer to the external storage then all the the new files are updated. I’ve also noticed that in the Nextcloud web interface: “Personal External Storage” when I click on the checkmark beside the shared directory in question I get a red stop sign looking symbol. I can’t figure out what that means but it can’t be a good thing. If I click that red symbol it goes away and becomes green.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Install Nextcloud
  2. Create Directory to mount as local external storage on server
  3. Set permissions to directory as 750 www-data:www-data
  4. Add the directory in web interface “Administration - External storages” Make available for my user. Check “Allow users to mount external storage” (check box comes up green)
  5. Check under web interface “Personal - External storages” New storage shows up. Click Checkbox beside it and a red symbol shows up. Click red symbol and it becomes green checkmark.
  6. Go to client machine and use the client interface “Select Settings and check to sync that directory” Directory syncs properly.
  7. Add new file to that directory on the server and set permissions on it properly.
  8. Nothing syncs because the directory is not rescanned.
  9. Try to call a manual rescan with the occ command but the directory does not exist under your user nextcloud/user_name/files/external_storage_should_be_here

The output of your Nextcloud log in Admin > Logging:

There are no log messages.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


The output of your Apache/nginx/system log in /var/log/____:


So I decided to create the missing directory inside my users files directory. That allowed me to run the files:scan command and it correctly did a sync. I’ve found that I can now delete that directory, as the files are never added to it, and continue to run the files:scan command and it works. This is really strange. But at least it is working now!

1 Like