-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.ocTransferIDXXXXX.part makes filename too long #25425
Comments
OC Logs:
|
This error message isn't generated in ownCloud, this means that the Please use the issue template, would be good to know what system and filesystem you are running on that would cause such errors. Is that an external storage ? https://raw.githubusercontent.com/owncloud/core/master/issue_template.md |
I guess maybe part files don't even need to have the real filename in them as long as the transfer id is there for the final rename. @owncloud/filesystem |
Steps to reproduce
Expected behaviourfile should be uploaded Actual behaviourphp error message above Server configurationOperating system: List of activated apps:
The content of config/config.php:
Are you using external storage, if yes which one: local/smb/sftp/... Client configurationBrowser: LogsWeb server error log
ownCloud log (data/owncloud.log)
|
Shared hosting, ok. Maybe they added a limit to file name lengths. |
I dont think its a Shared-Hosting-Specific problem, ext4 has 255bytes as max filename length. |
@DeepDiver1975 so we should limit file names to less than 255 due to suffixes. |
Maybe removing the original filename from .part files is a better idea… limiting filenames to <255 bytes could lead to the same problem: files generated by boxcryptor (and other encryption tools) cant be uploaded. |
also owncloud/enterprise#1366 Note that with the new chunking this problem is fixed anyway. |
A workaround might be: If the filename of the chunk-file incl. path is bigger than 250 chars, the actual file component is checked if it is long and can be shortened to fit the I am actually unsure as a) that is hacky, b) it is fixed with the new chunking anyway, c) its still a big change. |
@dragotin I think the fix doesn't require to affect whatever the client is sending. The fix only for how the part file and chunk file are stored on-disk. The name already doesn't match 100% what the client sends. So we could maybe md5 the filename there. |
Might be slightly related: #25214 Strange thing that boxcryptor generates names containing traditional chinese characters. |
I suggest to simply md5 the base name of the chunk file name on disk on the server side. @guruz are you still on this ? |
With this #29814 at least no more error logs appears. So far good. But there is one situation I am kind of stuck. While testing with delete operation, which results in moving the file to trashbin. This causes error:
https://github.com/owncloud/core/blob/master/lib/private/Files/Storage/Local.php#L269 is where the problem caused. The reason is for rename/move operation the target file has ".d" + timestamp associated with the file name. This makes the filename long ( I am using a filename which has 249 char length for testing ). |
Hmmmm so this means we have other hidden issues with longer file names... Same will likely happen for versions. |
@sharidas I suggest you ignore the trashbin/version issue for now as it would be for a different scope... I have the feeling that we need to rework how we store any data that currently reuses the file name and makes it longer like encryption keys, trashed files, trashed versions, etc... |
In theory for trashbin/versions, the data is anyway stored separately and not visible for end-users, so if we'd use md5's there as well it wouldn't hurt. I've raised #29819 to look into this. |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io.) |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io.) |
We will have much more trouble with md5 hashes, this is not really a solution IMHO. I don't see clean / other solutions for now. |
we might need to prevent OC to accept long filenames at all and fail gracefully |
Problem still exist with these Filenames. Actually I can solve this error with Boxcryptor when I disable the filename encryption. |
Just ran into that error on my Server, my exact Filename (encrypted by boxcryptor) is "倐哤幇岓奣划圵囩刜倃傤墑倩墌峂囱存底堝堁形屜孭啜屬囀凝匥媵忨噪厪婪媞妲匳墩密嵡寕征嫴啈宧吴厁宊埧姠偁儽忺入哄寘嚂屧剚室堙嶞初崵峋凗堡徟塮傳圔媀吽嶌孲執嬊 夾埬塝䀋.bc" which is 245 bytes long. after adding the .ocTransfer suffix it has 272 bytes…
that suffix should be kept in mind when limiting uploads to OC - or even better: a shorter or no suffix should be used.
ownCloud 9.0.3
The text was updated successfully, but these errors were encountered: