desktop icon indicating copy to clipboard operation
desktop copied to clipboard

"File contains trailing spaces and could not be renamed, because a file with the same name already exists locally." on next sync after renaming folders on server.

Open wonx opened this issue 3 years ago • 13 comments
trafficstars

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Expected behaviour

I synced a new Windows computer with my Nextcloud account. I received a bunch of errors during the synchronization because some files and folders were using filenames that are valid in Linux but not in Windows. For instance, filenames with trailing whitespaces, colons or same name in different capitalization.

So I decided to manually rename those items to meet Windows' standard, directly on the filesystem (external storage), and let Nextcloud rescan for these items.

Actual behaviour

The problem comes the next time I used my Linux computer. Nexcloud tried to sync those changes, but I got a lot of messages in the desktop client saying the following:

"File contains trailing spaces and could not be renamed, because a file with the same name already exists locally."

I believe what this means is that a folder in my filesystem was previously sync, nextcloud already removed the trailing whitespaces, and now is trying to sync the changes and finds out that file already exists. Essentially, a folder becomes duplicated, since the old one cannot be renamed, because the new name already exists.

By the way, I'm using the virtual filesystem in both operating systems, and the files are located on external storage.

Is there any way to force the synchronization and get rid of these messages? Other than manually removing these files one by one on the local filesystem?

Steps to reproduce

  1. Sync Nextcloud with Linux computer (using virtual filesystem)
  2. Rename a folder with trailing whitespaces (outside nextcloud) to remove them. Wait until Nextcloud finds those changes: _e.g.: "My cat " to "My cat"
  3. Wait until Nextcloud syncs again in Linux computer

Client configuration

Client version: 3.4.1 (Ubuntu)

Operating system: Ubuntu 20.04 LTS

OS language: Catalan

Qt version used by client package (Linux only, see also Settings dialog):

Client package (From Nextcloud or distro) (Linux only):

Installation path of client:

Server configuration

Nextcloud version: 23.0.0 (Nextcloud Hub II)

Storage backend (external storage): sftp

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer logs.

  1. Client logfile: Since 3.1: Under the "General" settings, you can click on "Create Debug Archive ..." to pick the location of where the desktop client will export the logs and the database to a zip file. On previous releases: Via the command line: nextcloud --logdebug --logwindow or nextcloud --logdebug --logfile log.txt (See also https://docs.nextcloud.com/desktop/3.0/troubleshooting.html#log-files)

  2. Web server error log:

  3. Server logfile: nextcloud log (data/nextcloud.log):

wonx avatar Jan 06 '22 19:01 wonx

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!

github-actions[bot] avatar Feb 04 '22 16:02 github-actions[bot]

bump

wonx avatar Feb 04 '22 17:02 wonx

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

github-actions[bot] avatar Feb 19 '22 01:02 github-actions[bot]

Same here, reproducible on two different machines.

When I manually delete the folder with the trailing space in the name, it get re-created. And what is strange: The folder name as it is on the server does not have a trailing space .

vasyugan avatar May 19 '22 13:05 vasyugan

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!

github-actions[bot] avatar Jun 17 '22 00:06 github-actions[bot]

bump

wonx avatar Jun 17 '22 16:06 wonx

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!

github-actions[bot] avatar Jul 16 '22 08:07 github-actions[bot]

This problem is still present in client 3.5.2

wonx avatar Jul 18 '22 15:07 wonx

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!

github-actions[bot] avatar Aug 16 '22 00:08 github-actions[bot]

The problem is still present in client 3.5.4

wonx avatar Aug 16 '22 16:08 wonx

Not sure if this necessarily helps you out, but here was my solution.

The pop-up dialog for Nextcloud Desktop didn't show the actual item that had a leading space. I was shown the full invalid filepaths of the files when I opened up the Settings window.

Since I found the file is a duplication of another file with the same name (but no leading space), I deleted the file on the web gui. Since that change didn't sync over to the desktop client correctly, I deleted the file from the directory it was in, and the client was no longer complaining.

NotYourAlejandro avatar Aug 17 '22 21:08 NotYourAlejandro

here was my solution

I tried that and am still getting a "conflict". The file no longer exists on my local drive or the server, yet the yellow warning message still comes up saying that there's an invalid name (leading spaces in my case).

I have tried renaming the file from the dialog that comes up when you click on the warning. I have tried renaming the file manually, both locally and remotely.

When using the dialog to rename, the rename happens successfully, the corrected file (and name) gets synced to the server nicely, but the warning still persists.

I have even tried deleting the entire containing folder, both locally and remotely - but it's still warning me to rename the file.

naniBox avatar Sep 12 '22 23:09 naniBox

I found a very similar issue with case sensitivity. If someone from a Linux machine renamed a file or folder from lowercase to uppercase, the changes will get sync'd to the server. However, in a Windows machine that will show an error, since Windows cannot rename the same file/folder with the same name but with different case, since it considers it's still the same name.

wonx avatar Sep 19 '22 01:09 wonx

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!

github-actions[bot] avatar Oct 17 '22 08:10 github-actions[bot]

I ended up deleting my entire local folder and re-syncing the 1.8GB over 3 days to solve this issue. There was nothing I could to do clear the error, no matter what I tried on the local machine to rename, delete, move, etc., the "offending" file. On a different machine, everything synced fine, given that the file just did not exist on the server and it appeared to be just a stale entry in the sqlite3 db.

naniBox avatar Oct 17 '22 08:10 naniBox

We are seeing this exact same issue as all the above mentioned items above. We have up to 60 clients syncing various windows and MAC clients. I might add we have also seen issues surrounding renaming files with capitalization. ie. Myfile.pdf to myfile.pdf. The result is either duplicated files, which produces errors or the file is removed from storage, but a reference remains in the file structure.

rgreeott avatar Nov 13 '22 04:11 rgreeott

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!

github-actions[bot] avatar Dec 11 '22 08:12 github-actions[bot]

This bug is still present in the 3.6.4. Please, do not mark it as stale.

wonx avatar Dec 11 '22 19:12 wonx

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

github-actions[bot] avatar Dec 26 '22 00:12 github-actions[bot]

This is still an issue, please reopen.

wonx avatar Dec 26 '22 03:12 wonx

Any news on this issue? Every time someone changes the capitalization of a file/folder in a linux computer, it causes synchronization errors in the Windows client, and it's a pain to fix manually every time. I think the client should be smart enough to resolve these renaming issues by itself.

wonx avatar Dec 30 '22 23:12 wonx

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!

github-actions[bot] avatar Jan 28 '23 00:01 github-actions[bot]

The issue is still present in the latest version of the client.

wonx avatar Jan 29 '23 20:01 wonx

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!

github-actions[bot] avatar Feb 27 '23 00:02 github-actions[bot]

This bug is still a current issue. Please, reopen.

wonx avatar Feb 27 '23 03:02 wonx

Very annoying bug. Someone will fix this or what? If file name ends with a space, it wont sync.

Delitants avatar Mar 11 '23 08:03 Delitants

I have seen this bug several times in the last couple of weeks.

vasyugan avatar Mar 13 '23 11:03 vasyugan

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!

github-actions[bot] avatar Apr 10 '23 16:04 github-actions[bot]

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

github-actions[bot] avatar Apr 24 '23 16:04 github-actions[bot]

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

You f kidding me?

Delitants avatar Apr 24 '23 16:04 Delitants