We are experiencing sync problems with filenames that contain certain characters. Files with + or # in the name fail to sync when using the Nextcloud Desktop app.
Example: test+file.docx or report#1.pdf
Files remain unsynced and show errors in the client.
Is this a known limitation or bug in the Desktop app? If so, is there any recommended workaround or planned fix for syncing files containing + or #?
The Basics
Nextcloud Server version (e.g., 29.x.x):
31.0.9.1
Operating system and version (e.g., Ubuntu 24.04):
This means there is no way to allow+ or # in filenames when syncing via the Desktop app, correct?
We also noticed the same behavior with certain file extensions (like .config, .cs, and bin/ folders) not being synced during a migration. Is there likewise no server-side “allow” option for these cases, and it’s only handled by the client ignore list?
I just want to be sure this is expected behavior and not a bug, so we can set the right expectations for our users.
With the extension, you can search for the code on github, if you click on blame so you can see which commit added this to the code, and the related pull request probably gives a hint.
For the characters, it is often done to be able to sync the files across all platforms and some operating systems/files systems have some restrictions (certain special characters/total path length / ….). If they do not apply for the systems you use, you can adapt these restrictions.
.htaccess in a folder is dangerous in case you use apache as a webserver because you can change the configuration.
app_data is a special folder in Nextcloud, and access to such named folders is probably blocked via webserver configuration. Perhaps it is possible to improve that, so direct access to the folder is still maintained but you still allow such folder names.
Then a few extensions are excluded by the Nextcloud client, but you have already disabled this. I don’t know, I have .dll files synced. In such a case, I’d take a new sync folder, put only the *.dll file, then check the client log, if that is preventing anything, then the server logs.
Windows had, and in certain constellations still has, a weird character limit for paths/file names. If you have very long paths or files names with more than ~250 characters in total, all kinds of strange side effects would occur. Maybe that has something to do with it?
For the rest of your bullet points, see the post by @tflidd.
Does Nextcloud also complain about the + and # characters when you upload those files via browser? If so, it’s likely your server configuration that is causing the issue, either the Nextcloud server config, webserver/reverse proxy config, or perhaps the storage where the Nextcloud data directory is located.
In this case we’d need more information about your server configuration to see if we might be able to identify the cause:
Web server / reverse proxy configuration
OS, database, installation method
Nextcloud configuration (the output of occ config:list)
Storage configuration
Apps you have installed (occ app:list)
Any error messages or warnings from the logs (nextcloud.log, and maybe webserver logs)
…which are all things that are asked for in the support template, btw.
If it works via the browser:
Try to completely uninstall the client on a PC, including deleting the Nextcloud folders under c:\Users\user\AppData\Roaming and c:\Users\user\AppData\local, and then re-install the client and set it up again with the latest version.
Web server / reverse proxy configuration:
Apache 2.4.52 on Ubuntu.
No reverse proxy (Apache serves Nextcloud directly).
Active vhost: /etc/apache2/sites-enabled/nextcloud-ssl.conf.
OS, database, installation method:
Ubuntu (same host as Apache).
MariaDB 10.6 with standard Nextcloud DB schema.
Nextcloud configuration (occ config:list):
Main points:
– check_for_windows_file_names is set to false.
– filelocking.enabled is false.
– Data directory: /var/nextcloud_data.
Storage configuration:
Local storage on the same server (no external mounts).
I also tried via the browser and got this result: I can upload other files without any issues via the browser.
Okay, so we now know that the server returns a 404 error when a file with + or # character is uploaded, so the problem is most likely on the server side.
However, we would still need either a crystal ball or more information from you to help you solve the problem.
This includes logs and full configurations, as I wrote in my previous post, and not just what you think might be important.
Also, is Nextcloud running behind a reverse proxy and/or web application firewall?
Or are there maybe any Files or FilesMatch directives in the web server config with deny or require all denied or similar? What do the webserver logs say (Apache access.log and error.log)?
I mean seriously, come on, what are we supposed to do with that? The content of the file is what would be interesting, you realize that yourself, right?
Some older Linux OS have difficulties with filenames containing forbidden characters like “+” or “#”, because they in many cases are interpreted as control-characters (artihmetic operator resp comment).
Your Ubuntu is 3 years old and as I see it right, the guys trying to help you use Ubuntu 24 or similar new versions.
I also had issues with OpenSuse 15.1 and older a few years ago, but they mostly were gone with newer versions.
This may be a reason but I am not sure.
Annother reason can be related to the selected System chracter-set.
Good news: after adding 'check_for_windows_file_names' => false to config.php, the sync issue with files containing +, #, &, %, and $ has been solved. But there are still sync issues with files such as .exe, .dll, .htaccess, .ascx, .mdf, .ldf, .resx, .csproj, and .csp. and for mac users is the same error for + and # files!It just works for win.
Good news: after adding 'check_for_windows_file_names' => false to config.php, the sync issue with files containing +, #, &, %, and $ has been solved. But there are still sync issues with files such as .exe, .dll, .htaccess, .ascx, .mdf, .ldf, .resx, .csproj, and .csp. and for mac users is the same error for + and # files!It just works for win.
Hmm, ok, but that feels like kind of an ugly workaround, imho. You probably don’t want to allow characters that actually are forbidden in Windows. What’s strange here is that +, #, &, %, and $ are definitely not forbidden characters in Windows, so they really shouldn’t be blocked even without that parameter.
Yeah, afaik, at least .htaccess may be hardcoded, and if so for good reasons. I’m not sure about all the others, but I tested a few you listed (.exe, .dll, .ascx, .mdf, .csp) by simply renaming a text file, and they all synced fine.
However, I also just noticed that on my instance everything works, and I mean everything, as in literally all characters, even the ones that are actually forbidden in Windows like ? or \. The only exception is .htaccess, which I explicitly have listed in config.php as a forbidden filename. Also, I don’t see the parameter 'check_for_windows_file_names' in my config.sample.php.
So, at this point, I have to admit that I have no idea why our servers behave the way they do. I guess I now need to figure out why my instance doesn’t block anything — not even the characters it actually should — while you need to figure out why yours is blocking too much.
Good to know it’s not a Nextcloud bug – that’s a relief!
Can you share a bit about your setup? Like what OS you’re on and if you’ve tweaked anything special in Apache, PHP or your config.php (besides the forbidden filename list you mentioned).
Would be nice to compare notes and see what’s different on my side.