nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.97k stars 784 forks source link

sync error: File name too long #467

Open voxspox opened 6 years ago

voxspox commented 6 years ago

TODO

Steps to reproduce

  1. add file on another computer (macOS) or webinterface
  2. Nextcloud sync client (2.3.3) on my computer (Linux) fails with "File name too long"

Expected behaviour

sync file

Actual behaviour

charaters: filename: 150 filepath: 211 (inside cloud folder) absolute filepath: 236 (in the filesystem)

if I reduce the filename to 144 chars the file gets synced as usual.

Nextcloud version: 13.0.4

There is no problem on the macOS computer, but on my Linux computer. May be this issue is related to Linux, ecryptfs, ext4.

esalgado commented 6 years ago

This happens to me as well. In file synced from a windows client, does not sync in Linux, ecryptfs, ext4 client.

rohlandm commented 5 years ago

I also tried to sync a folder encrypted using gocryptfs, and some files fail to sync because of "File name too long"

Edit: Server: 16.0.1, Debian 9, official Docker Image Client: 2.5.1, Ubuntu 19.04

akurzawa commented 4 years ago

Server 17, client 2.6 windows.

Filename too long Is it too long for nextcloud indeed?

[PHP] Error: file_put_contents(/CloudBackupData/xxx.xxx/files/Pulpit/USTAWY PRZEPISY NOTATKI/Przekształcenie prawa użytkowania wieczystego gruntu zabudowanego na cele mieszkaniowe w prawo własności tego gruntu - procedura realizowana na podstawie przepisów ustawy z dnia 20 lipca 2018 r. o przekształceniu prawa użytkowania.html.ocTransferId2014978277.part): failed to open stream: File name too long at /var/www/nextcloud/lib/private/Files/Storage/Local.php#488

PUT /remote.php/dav/files/xxx.xxx/Pulpit/USTAWY%20PRZEPISY%20NOTATKI/Przekszta%C5%82cenie%20prawa%20u%C5%BCytkowania%20wieczystego%20gruntu%20zabudowanego%20na%20cele%20mieszkaniowe%20w%20prawo%20w%C5%82asno%C5%9Bci%20tego%20gruntu%20-%20procedura%20realizowana%20na%20podstawie%20przepis%C3%B3w%20ustawy%20z%20dnia%2020%20lipca%202018%20r.%20o%20przekszta%C5%82ceniu%20prawa%20u%C5%BCytkowania.html
zlukenic commented 4 years ago

same problem but error message is not god. File name is not to long it's just because there is strange caracter just before the file extension. in my case the file name was "BL PRET ATELIER INCUBES BLI21000 2017.05.03.pdf"

resolution: just rename file by deleting one caracter before the extension (.pdf)

alexanderdd commented 4 years ago

Ideally, Nextcloud Web interface should not accept file names (when you create/rename) that are too long, that would be an issue in server - anybody know if there is an issue about that already? I only found this but it is slightly different issue https://github.com/nextcloud/server/issues/4046

For the client, there should be a more helpful error message telling the user how to resolve the problem. Ideas:

danielwbn commented 3 years ago

I have the same error: the linux client (v 3.0.2) fails to download files with long file names (in my case 140 chars). If I shorten the names in the web client (NC 19.0.4) they download fine. Also, I can create files with such long names (or rename the files after download to original long name) on the linux PC (ext4, ecryptfs) just fine and they do sync back to nextcloud server via the same client.

danielwbn commented 3 years ago

I just updated to NC client version 3.1.0 (Ubuntu) and still have the same error

github-actions[bot] commented 3 years ago

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!

danielwbn commented 3 years ago

NC client 3.2.1 still gives same error. However, I am beginning to think it might not be related to the NC client, but to my system. I have not investigated this further, but when I call "getconf NAME_MAX ./" (which I think returns the maximum filename length) in the sync folder in question (or in fact anywhere in my home dir) I get 143 in return. Calling "getconf NAME_MAX /" returns 255.

github-actions[bot] commented 3 years ago

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!

alexanderdd commented 3 years ago

This happened to me a few days ago on Nextcloud 20.0.10 A long filename was created online but could not be synced to my linux machine with the error "file name too long"

mgallien commented 3 years ago

Can you test against the latest version of desktop client ? If you can reproduce it, we will need the desktop logs (at least) to be able to understand what is going wrong. If this is fixed, can you close the issue ?

danielwbn commented 3 years ago

nextcloud desktop 3.2.2, I get the same error. The log file is probably way too long to paste here (>50MB), but I think I found the relevant lines:

2021-06-14 11:45:19:078 [ info nextcloud.sync.propagator ]: Starting CSyncEnums::CSYNC_INSTRUCTION_NEW propagation of "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" by OCC::PropagateDownloadFile(0x558d082b6390) 2021-06-14 11:45:19:078 [ debug nextcloud.sync.propagator.download ] [ OCC::PropagateDownloadFile::start ]: "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" 1 2021-06-14 11:45:19:078 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::bindValue ]: SQL bind 1 "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" 2021-06-14 11:45:19:078 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::exec ]: SQL exec "SELECT tmpfile, etag, errorcount FROM downloadinfo WHERE path=?1" 2021-06-14 11:45:19:078 [ warning nextcloud.sync.propagator.download ]: could not open temporary file "/home/daniel/Nextcloud/.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md.~2efc2ce" 2021-06-14 11:45:19:078 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::bindValue ]: SQL bind 1 "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" 2021-06-14 11:45:19:078 [ debug nextcloud.sync.database.sql ] [ OCC::SqlQuery::exec ]: SQL exec "SELECT lastTryEtag, lastTryModtime, retrycount, errorstring, lastTryTime, ignoreDuration, renameTarget, errorCategory, requestId FROM blacklist WHERE path=?1" 2021-06-14 11:45:19:079 [ warning nextcloud.sync.propagator ]: Could not complete propagation of "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" by OCC::PropagateDownloadFile(0x558d082b6390) with status OCC::SyncFileItem::NormalError and error: "Der Dateiname ist zu lang" 2021-06-14 11:45:19:079 [ debug nextcloud.sync.statustracker ] [ OCC::SyncFileStatusTracker::slotItemCompleted ]: Item completed "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" OCC::SyncFileItem::NormalError CSyncEnums::CSYNC_INSTRUCTION_NEW 2021-06-14 11:45:19:079 [ warning nextcloud.gui.activity ]: Item "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" retrieved resulted in "Der Dateiname ist zu lang" 2021-06-14 11:45:19:079 [ warning nextcloud.gui.activity ]: Item "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md" retrieved resulted in error "Der Dateiname ist zu lang"

mgallien commented 3 years ago

@danielwbn I will need more detail because I cannot reproduce the bug with a build from master branch running on Windows and Linux

Could you try sending a full log archive by syncing a test directory with only your test file ?

github-actions[bot] commented 3 years ago

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] commented 3 years ago

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

georgloesel commented 2 years ago

Ideally, Nextcloud Web interface should not accept file names (when you create/rename) that are too long, that would be an issue in server - anybody know if there is an issue about that already? I only found this but it is slightly different issue nextcloud/server#4046

For the client, there should be a more helpful error message telling the user how to resolve the problem. Ideas:

  • "File name exceeds maximum of 255 characters"
  • "File name too long. Click here to truncate to maximum allowed length"

Hi,

I had just the very same problem and the propsed solution from @alexanderdd would be perfect. Is there any activity in this issue? How can it be reopend and pushed?

Thanks

georgloesel

mgallien commented 2 years ago

@georgloesel that issue got closed because I need logs of someone reproducing the issue and I got no reply.

I will need more detail because I cannot reproduce the bug with a build from master branch running on Windows and Linux

Could you try sending a full log archive by syncing a test directory with only a test file ?

github-actions[bot] commented 2 years ago

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!

solracsf commented 2 years ago

@mgallien what if you create a file like

1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md

And you try to upload it? Can't you reproduce it? In my instance, it always produces this error.

github-actions[bot] commented 2 years ago

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

github-actions[bot] commented 2 years ago

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] commented 2 years ago

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!

solracsf commented 2 years ago

ping @mgallien (see https://github.com/nextcloud/desktop/issues/467#issuecomment-1037222376)

github-actions[bot] commented 2 years ago

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!

mgallien commented 2 years ago

@solracsf sorry for the delay

I tested but I am not sure what would be the steps I did

LANG=C touch 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md
touch: cannot touch '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.md': File name too long

So I expect the storage used by nextcloud server would similarly block the creation of such a long file name

solracsf commented 2 years ago

Well, on Windows, you can create such file. Error is produced when file is uploaded to Nextcloud.

image

It works on Linux too:

image

Exact file name is

touch 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901.md

And here is the error (client v3.5.1)

image

@mgallien hope you can reproduce it now :)

github-actions[bot] commented 2 years ago

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] commented 2 years ago

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] commented 2 years ago

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

solracsf commented 2 years ago

Hey @mgallien a friendly ping here 👍

tobiasKaminsky commented 2 years ago

I can reproduce this on Linux, with above long 12345678901234567890… file name.

github-actions[bot] commented 1 year ago

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!

alexanderdd commented 1 year ago

(comment to remove stale label)

github-actions[bot] commented 1 year ago

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!

AndyScherzinger commented 1 year ago

removed stale and set to "to develop" based on https://github.com/nextcloud/desktop/issues/467#issuecomment-1241645735 that it can be reproduced

AshleyJohnson99 commented 1 year ago

Same bug here. I can upload file with to long paths from windows but cant sync them on linux. I use cryptomator, so I can't find the corresponding files which are too long. Linux NC Client 3.5.4 Windows NC Client 3.4.1 Cryptomator Windows 1.6.5 (msi-3397) I attached the log file from the linux client. I hope there is no private data included, otherwise please delet the log-file after downloading it. 20221126_1240_owncloud.log.0.txt

just saying: This bug lead me to leave linux and nextcloud for quite some time and fall back to windows due to heavy work load.

github-actions[bot] commented 1 year ago

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] commented 1 year ago

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

anonbergine commented 1 year ago

Just run in to this error.

Dragged an image out of a web browser on to local drive in a folder that's managed by NC, and now getting the error. There doesn't appear to be any way to fix it at all.

Normally I can use old-school cmd prompt and do a dir /x to see the 8.3-style filename, and then delete that.

13/01/2023  06:51            23,881 HRB          HrbyFl0Q3AVOptlJJSnQ4AmZpBA0_UhiEDDvGTQZbvvrq_HLudeCzhZAqvGTVJ4C0yEvclEwqO-7790VldeqkAdJj38JKe-XSqx-BpLXwPbkKTuKNWg4lhoSr9zVjGQzynNxP2Y5aE5KRi9pEXQRVT4mc5OVM5TNjDVtJcHSZvHlD-otkaUgaQvN9-CaFF7eB9X8VLjKLBJ2gulmHaOKxfWyBn93_5wJzCQEEcRu_QpHXCEl5d4dcNVT9kJ.jpg

As you can see above, the 8.3 filename is just HRB, however del HRB does not work. I suspect this is becuase NC is holding on to the file until it syncs, but obviously it can't sync because name too long.

image

Anyone know of a way to delete the file that has too-long filename from an NC-managed folder on local disk? I'm on Windows 10.

Suggestion: Link on NC context menu, or the NC tray menu (where error is shown), to delete/rename the file.

EDIT: Found a workaround:

  1. Go to folder with the problem file
  2. Move all the non-broken things (incl. subfolders) in to a different folder
  3. Delete the folder that cotnains the problem file

Hopefully this is of use to others running in to this problem on Win10 (:

github-actions[bot] commented 1 year ago

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!

anonbergine commented 1 year ago

Still present in 3.7.3

github-actions[bot] commented 1 year ago

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!

anonbergine commented 1 year ago

still not fixed as far as I am aware

github-actions[bot] commented 1 year ago

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!

akurzawa commented 1 year ago

Bug still present

pcismejr commented 1 year ago

I have this same issue with latest version.

github-actions[bot] commented 1 year ago

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] commented 1 year ago

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

kintaro1981 commented 1 year ago

Same problem with latest macos client.

I have a 251 characters filename (254 with extension) and is not getting synced.