Server: New folders and files with whitespace at the end of the filename cannot get synced to Windows

Created on 7 Oct 2018  路  7Comments  路  Source: nextcloud/server

Steps to reproduce

  1. 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.

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_ldap

Nextcloud 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

Logs

Web server error log


Web server error log
No errors.

Nextcloud log (data/nextcloud.log)


Nextcloud log
Nope.

Browser log


Browser log
Nope.

bug

All 7 comments

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/issues/3072 (Folders and items ending with ~ are not synced to the server), https://github.com/nextcloud/server/issues/8386 (Can't sync file with tab or newline character in filename), https://github.com/nextcloud/server/issues/7869 (Nextcloud Windows-Client does not sync folders with a space " " in the end), https://github.com/nextcloud/server/issues/5843 (Trailing Whitespace Directory breaks Nextcloud Sync and Windows Explorer), and https://github.com/nextcloud/server/issues/1352 (Widnows client cannot add files by sync to shared folder).

Upon seeing so many duplicates, and how long this has been going on, I'm proposing a simple solution. Like the "blacklisted_files" section in the config.php, please just expand that so we can use regex matching in there, or add a new section like "blacklisted_files_regex". All I want is that functionality expanded, and I'll be perfectly happy with the result.

Oh, and btw: create a new file called "%.txt" and watch how your files in that directory won't show up anymore in web gui.

We've just been struck by this issue. Any plans to fix it?

Fix in #13947. Scheduled for 15.0.4.

Only the whitespace issue is fixed. Not sure if %.txt works. May I ask you to open another issue?

Oh, and btw: create a new file called "%.txt" and watch how your files in that directory won't show up anymore in web gui.

where did you find this behaviour? I tested it in v13 and v15 and couldn't replicate it in windows or the webgui

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChristophWurst picture ChristophWurst  路  3Comments

MorrisJobke picture MorrisJobke  路  3Comments

ghost picture ghost  路  3Comments

blackcrack picture blackcrack  路  3Comments

georgehrke picture georgehrke  路  3Comments