Can't sync files/folders starting with a dot (to external SMB storage)

Nextcloud version (eg, 18.0.2): 18.0.4
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04 (Using Nextcloud-VM from https://www.hanssonit.se/nextcloud-vm/)

The issue you are facing:
All files and folders beginning with a dot (.git, .project, …) are not synced from my Windows machine with the Nextcloud Client. This only happens when syncing with an external SMB-Store in Nextcloud (NC Client shows “404 Not found” for theses files). The default Nextcloud-Store works fine.
Background: I want to sync my web projects with my self-hosted Nextcloud. As I dont want to store the data within the VM, I setup a shared folder on the Windows host system and added it as “external storage”.

Is this the first time you’ve seen this error? (Y/N): Yes. Never used Nextcloud before and this happended from the very beginning.

Steps to replicate it:

  1. Add external SMB storage in Nextcloud (in my case it’s a shared folder of a windows 8.1 system)
  2. Setup Nextcloud client on your Windows machine and sync a folder with the SMB-Store
  3. Add a file beginning with a dot (e.g. “.test”) and let the client sync. The file will not be synced.

The output of your Nextcloud log in Admin > Logging: (I changed the remoteAddr to ***)

{"reqId":"CleKwuhLkohMTvcyFd1r","level":3,"time":"2020-05-27T14:31:23+02:00","remoteAddr":"***","user":"Michael","app":"remote","method":"PUT","url":"/remote.php/dav/files/Michael/Homeserver-Michael/.test","message":{"Exception":"Error","Message":"Call to a member function getId() on array","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php","line":179,"function":"remove","class":"OC\\Files\\Cache\\Cache","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":272,"function":"remove","class":"OC\\Files\\Cache\\Wrapper\\CacheWrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":241,"function":"removeFromCache","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":337,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1578,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":318,"function":"putFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1096,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":525,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":319,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":165,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Cache/Cache.php","Line":516,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/2.6.4stable-Win64 (build 20200303) (Nextcloud)","version":"18.0.4.2"}

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

I am currently unable to access the /var/www/nextcloud folder. Have to check why this is not possible within the VM...

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

Had a look at syslog and apache2/error.log but there seem to be no related entries.

Enabling synchronization of hidden files is NOT the solution. The behaviour is the same. I also deleted all the ignored file patterns.
A “.test” file is not synced with the SMB-Store. But it is synced with the normal local Nextcloud-Store.

Then they are veto files. Adjust smb.conf

In my /etc/samba/smb.conf no veto files are set (searched for “veto” - no results)

Interestingly, even if the Nextcloud client shows errors, some files starting with a dot are syned. I again created a file starting with a dot => the client says that an error occured, but the file was synced to my SMB-Store. However, in some other cases (e.g. “.metadata” folder) synchronization is not possible. The .metadata folder was created in the SMB-Store but is empty (many different files should be part of this directory)

Its a really annoying problem for me as I use the SMB-Store as a source for backups. So all these files are excluded from my backups :confused: