New folders and files with whitespace at the end of the filename don't get synced to Windows automatically
Steps to reproduce
- Create new text file or new folder via web interface with one or more spaces at the end of the name. For example "My new folder " or "whatever.txt "
Expected behaviour
Whitespace at the end of the filename should be truncated when new file or folder is created via web interface.
Actual behaviour
Whitespace at the end of the filename doesn't get truncated. Result is, such file or folder doesn't get synced to Windows clients, because Windows doesn't allow filenames with whitespace at the end, while Linux does. If you create a file or folder on Windows with whitespace at the end, it gets automatically truncated.
This is a long time bug, and apparently still around from the ownCloud days. I have clients who create new folders via web interface, and for some unexplicable reason add another space at the end of the new folder name. Such folders and their contents don't get synced to Windows via Sync client, until I manually rename them on the Linux server. This has to be able to get "fixed" automatically, without requiring manual intervention every time.
Server configuration
Operating system: Linux 3.10.0-862.14.4.el7.x86_64
Web server: nginx/1.14.0
Database: mysql Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1
PHP version: PHP 7.3.0RC2
Nextcloud version: (see Nextcloud admin page) 14.0.1
Updated from an older Nextcloud/ownCloud or fresh install: Fresh install.
Where did you install Nextcloud from: https://download.nextcloud.com/server/installer/setup-nextcloud.php
Signing status:
Signing status
No errors have been found.List of activated apps:
App list
Enabled: - accessibility: 1.0.1 - activity: 2.7.0 - camerarawpreviews: 0.5.6 - checksum: 0.4.1 - cloud_federation_api: 0.0.1 - comments: 1.4.0 - dav: 1.6.0 - external: 3.1.0 - federatedfilesharing: 1.4.0 - files: 1.9.0 - files_downloadactivity: 1.3.0 - files_markdown: 2.0.4 - files_pdfviewer: 1.3.2 - files_sharing: 1.6.2 - files_texteditor: 2.6.0 - files_trashbin: 1.4.1 - files_versions: 1.7.1 - files_videoplayer: 1.3.0 - gallery: 18.1.0 - logreader: 2.0.0 - lookup_server_connector: 1.2.0 - nextcloud_announcements: 1.3.0 - notifications: 2.2.1 - oauth2: 1.2.1 - onlyoffice: 2.0.4 - password_policy: 1.4.0 - provisioning_api: 1.4.0 - serverinfo: 1.4.0 - sharebymail: 1.4.0 - systemtags: 1.4.0 - tasks: 0.9.7 - theming: 1.5.0 - twofactor_backupcodes: 1.3.1 - updatenotification: 1.4.1 - workflowengine: 1.4.0 Disabled: - admin_audit - encryption - federation - files_external - firstrunwizard - support - survey_client - user_external - user_ldapNextcloud configuration:
Config report
{ "system": { "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusted_domains": [ "REMOVED SENSITIVE VALUE" ], "datadirectory": "REMOVED SENSITIVE VALUE", "dbtype": "mysql", "version": "14.0.1.1", "overwrite.cli.url": "REMOVED SENSITIVE VALUE", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbport": "", "dbtableprefix": "oc_", "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "memcache.local": "\OC\Memcache\APCu", "memcache.locking": "\OC\Memcache\Redis", "mail_from_address": "REMOVED SENSITIVE VALUE", "mail_smtpmode": "smtp", "mail_smtpauthtype": "PLAIN", "mail_smtphost": "REMOVED SENSITIVE VALUE", "mail_domain": "REMOVED SENSITIVE VALUE", "mail_smtpport": "25", "updater.release.channel": "production", "simpleSignUpLink.shown": false } }
Are you using external storage, if yes which one: No
Are you using encryption: No
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Chrome 69.0.3497.100 (Official Build) (64-bit)
Operating system: Windows 10
OS language: English (US)
Installation path of client: C:\Program Files (x86)\Nextcloud
Client version: 2.3.3 (build 1)
Logs
Web server error log
Web server error log
No errors.Nextcloud log (data/nextcloud.log)
Nextcloud log
Nope.Browser log
Browser log
Nope.
Hi! I think you forgot to add the desktop client version ;-). Please do. Thanks!
Hi! I think you forgot to add the desktop client version ;-). Please do. Thanks!
Done. But I researched this issue further and I realised, while people at the "server" GIT are saying this is a Client issue, it really is not. I mean, it could be solved in a number of different ways.
To solve this in clients, we would need to have a database on the client side, containing unsupported filenames and have it rename the files on download & upload accordingly, "on the fly".
But a much simpler way would be to just allow us to manually define unsupported characters in file names on the server side. If you host NextCloud server on Windows for example, this issue is avoided entirely. Or you can even have it hosted on Linux and just set it's data directory to a local NTFS formatted volume, which is what I'm doing now, as this issue has been apparently posted many times already and still hasn't been solved.
I realise though, that my thinking is biased towards Windows users, as this is usually the situation that I'm dealing with - Linux server, all Windows clients.
I have this issue too, noticed by one of my users this morning. Scary...
I got this Issue too. At least show an sync error (red X). At the moment nothing is shown. log-message (German): [OCC::ActivityListModel::addErrorToActivityList Error successfully added to the notification list: "Dateiname endet mit Leerzeichen."
Reported a similar problem ( trailing DOT - e.g. ". " a bout a year ago - but was reported on server repo.
nextcloud/server#18066
Now I can confirm issues also with the HASH character # - at any poition of filename ( not only trailing )
Another related / linked open issues can be found at #464 and #707 and some others.
They all seem to be originated from the same issue or BUG of filname handling
Clearly related to #464 but maybe let's not close as a duplicate yet. This is a special case easy to overlook when trying to produce something for #464.
Space trailing dirs are mainly created by Mac clients. Just tried on Android and trailing space gets trimmed. Workaround at 18066
This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!
Also seeing this issue. Another user shared a folder named with a trailing space with me, and it does not sync to my Windows 10 client. Sync logs show a Filename contains trailing spaces. warning - further logs below.
The user had to rename the folder to remove the trailing space and re-share before it would show up for me.
2021-05-20 19:00:33:945 [ info nextcloud.sync.propagator ]: Starting CSyncEnums::CSYNC_INSTRUCTION_IGNORE propagation of "James - iPhone 11 Pics " by OCC::PropagateIgnoreJob(0x219b044b3a0)
2021-05-20 19:00:33:945 [ warning nextcloud.sync.propagator ]: Could not complete propagation of "James - iPhone 11 Pics " by OCC::PropagateIgnoreJob(0x219b044b3a0) with status OCC::SyncFileItem::FileIgnored and error: "Filename contains trailing spaces."
2021-05-20 19:00:33:945 [ debug nextcloud.sync.statustracker ] [ OCC::SyncFileStatusTracker::slotItemCompleted ]: Item completed "James - iPhone 11 Pics " OCC::SyncFileItem::FileIgnored CSyncEnums::CSYNC_INSTRUCTION_IGNORE
2021-05-20 19:00:33:945 [ warning nextcloud.gui.activity ]: Item "James - iPhone 11 Pics " retrieved resulted in "Filename contains trailing spaces."
2021-05-20 19:00:33:945 [ warning nextcloud.gui.activity ]: Item "James - iPhone 11 Pics " retrieved resulted in error "Filename contains trailing spaces."
2021-05-20 19:00:33:945 [ info nextcloud.gui.activity ]: First checking for duplicates then add file to the notification list of ignored files: "James - iPhone 11 Pics "
I think we can not solve this issue as Windows does not allow trailing whitespaces in file names. The best thing we can do I think is to provide the user with a warning. I also think the original bug report is about the web interface, and not the client. If you want something solved in the web interface, you should file a bug in their repo https://github.com/nextcloud/server.
@FlexW I can't replicate this issue in the Web UI, I think the issue is that Mac allows trailing whitespace in file/folder names and the Mac Nextcloud client will sync them up to include this.
@sbgillett Yes, but we can not prevent macOS or Linux from creating files with trailing whitespace.
I'd suggest then that sync up should throw an error, given that syncing files/folders named with trailing whitespace is not cross-platform friendly.
@sbgillett Okay. Could you file a new issue for that? I would suggest we just throw an warning.
Done 😄 https://github.com/nextcloud/desktop/issues/3366