Skip to content
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

Download file with long filename failing on eCryptfs #2084

Closed
TheNavigat opened this issue Jun 22, 2020 · 3 comments
Closed

Download file with long filename failing on eCryptfs #2084

TheNavigat opened this issue Jun 22, 2020 · 3 comments
Assignees
Labels
p3 This is a minor priority issue s3 third-party

Comments

@TheNavigat
Copy link

This is a clone of #1916 (comment) since the issue is still occuring.

I commented with #1916 (comment), but since this didn't reopen the issue, I think the best thing to do is to reopen a new bug report.

Here are the exact commands I use:

$ aws s3 cp s3://bucket-name/dirname dirname --recursive
download failed: s3://bucket-name/dir-name/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz to dir-name/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz [Errno 36] File name too long: '/home/nav/dir-name/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz.8C2e65Fa'

If I'm understanding this correctly, this is because I'm using eCryptfs which requires filenames to be less than 140 characters (based on https://unix.stackexchange.com/a/32834/215614). So the fix would be checking the actual system's filename limit and creating the temp file name based on that, or just lowering the 255 limit to 140.

@TheNavigat TheNavigat added the needs-triage This issue or PR still needs to be triaged. label Jun 22, 2020
@TheNavigat TheNavigat changed the title Download file with long filename failing Download file with long filename failing on eCryptfs Jun 22, 2020
@swetashre swetashre self-assigned this Jun 25, 2020
@swetashre
Copy link
Contributor

@TheNavigat - Thank you for your post. Currently we are using a max file length of 255. To make it to work with every file system we need to check for system's filename limit before creating temp file. Marking this as a bug.

From the article you linked it looked like if filenames are not encrypted, then you can safely write filenames of up to 255 characters and encrypt their contents, as the filenames written to the lower filesystem will simply match. In the meantime you can change you code to use 140 as max file length and make it to work.

@swetashre swetashre added bug This issue is a confirmed bug. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 25, 2020
@TheNavigat
Copy link
Author

I don't know if there's an easy way to change whether eCryptfs encrypts the filename on a currently running system.

However, I modified the code and lowered the limit to 140, and that worked indeed. Thanks a lot!

@swetashre swetashre assigned kdaily and unassigned swetashre Mar 25, 2021
@RyanFitzSimmonsAK RyanFitzSimmonsAK added the p3 This is a minor priority issue label Nov 8, 2022
@tim-finnigan tim-finnigan assigned tim-finnigan and unassigned kdaily Nov 22, 2022
@tim-finnigan tim-finnigan added third-party s3 and removed bug This issue is a confirmed bug. labels Nov 22, 2022
@tim-finnigan
Copy link
Contributor

Checking in - I saw a related comment here: aws/aws-cli#3514 (comment). 255 characters does seem to be the system default but I believe S3 itself has a 1024 character limit. Regardless - it seems like this specific issue related to a third-party service and a solution was found. Based on that I think this issue can be closed, but please let us know if you had any follow up questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 This is a minor priority issue s3 third-party
Projects
None yet
Development

No branches or pull requests

5 participants