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

org-web-tools-archive-attach fails: Cannot open: File name too long #74

Open
nico202 opened this issue Oct 19, 2024 · 5 comments
Open
Assignees
Milestone

Comments

@nico202
Copy link

nico202 commented Oct 19, 2024

Hi, I was trying to archive this page and org-web tools-archive-attach failed: https://wasaiya.com/%e6%b5%b4%e8%a1%a3%e3%81%ae%e4%bb%95%e7%ab%8b%e3%81%a6%e3%80%80%e5%8d%98%e8%a1%a3%e3%81%ae%e4%bb%95%e7%ab%8b%e3%81%a6%e2%91%a4/

The problem is, it's trying to compress this folder whose name is too long: /tmp/org-web-tools-archive-9SciAV/https%3A%2F%2Fwasaiya.com%2F%25e6%25b5%25b4%25e8%25a1%25a3%25e3%2581%25ae%25e4%25bb%2595%25e7%25ab%258b%25e3%2581%25a6%25e3%2580%2580%25e5%258d%2598%25e8%25a1%25a3%25e3%2581%25ae%25e4%25bb%2595%25e7%25ab%258b%25e3%2581%25a6%25e2%2591%25a4%2F--9SciAV.tar.xz

my workaround was to modify org-web-tools-archive--wget-tar and with

(substring (url-hexify-string url)  0 (min 30 (length (url-hexify-string url))))

(30 is just a short number I decided to try, as 100 was still too much)

@alphapapa
Copy link
Owner

Most filesystems have very long filename length limits. What filesystem are you trying to save it on?

@nico202
Copy link
Author

nico202 commented Oct 20, 2024

I guess the problem does not depend on the filesystem, rather on tar limiting filenames in archive to 256 bytes
The fs is ext4
Thanks!

@alphapapa
Copy link
Owner

I think we need to start over. Please provide an exact copy of the error message.

@nico202
Copy link
Author

nico202 commented Oct 21, 2024

org-web-tools version: 1.3
clipboard: https://wasaiya.com/%e6%b5%b4%e8%a1%a3%e3%81%ae%e4%bb%95%e7%ab%8b%e3%81%a6%e3%80%80%e5%8d%98%e8%a1%a3%e3%81%ae%e4%bb%95%e7%ab%8b%e3%81%a6%e2%91%a4/
M-x org-web-tools-archive-attach

Warnings buffer:

FINISHED --2024-10-21 09:19:14--
Total wall clock time: 38s
Downloaded: 48 files, 1,5M in 8,4s (183 KB/s)
Converting links in files/index.html... 70.
69-1
Converting links in files/style-hpb.css... nothing to do.
Converting links in files/style.css... 16.
16-0
Converting links in files/style.min.css?ver=5.3.18.css... nothing to do.
Converted links in 4 files in 0,004 seconds.
tar (child): /tmp/org-web-tools-archive-E4JrfD/https%3A%2F%2Fwasaiya.com%2F%25e6%25b5%25b4%25e8%25a1%25a3%25e3%2581%25ae%25e4%25bb%2595%25e7%25ab%258b%25e3%2581%25a6%25e3%2580%2580%25e5%258d%2598%25e8%25a1%25a3%25e3%2581%25ae%25e4%25bb%2595%25e7%25ab%258b%25e3%2581%25a6%25e2%2591%25a4%2F--E4JrfD.tar.xz: Cannot open: File name too long
tar (child): Error is not recoverable: exiting now
/usr/bin/tar: /tmp/org-web-tools-archive-E4JrfD/https%3A%2F%2Fwasaiya.com%2F%25e6%25b5%25b4%25e8%25a1%25a3%25e3%2581%25ae%25e4%25bb%2595%25e7%25ab%258b%25e3%2581%25a6%25e3%2580%2580%25e5%258d%2598%25e8%25a1%25a3%25e3%2581%25ae%25e4%25bb%2595%25e7%25ab%258b%25e3%2581%25a6%25e2%2591%25a4%2F--E4JrfD.tar.xz: Wrote only 4096 of 10240 bytes
/usr/bin/tar: Child returned status 2
/usr/bin/tar: Error is not recoverable: exiting now

tar version: tar (GNU tar) 1.35
df -Th /tmp/

Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/nvme0n1p6 ext4  245G  231G  1,7G 100% /

@alphapapa
Copy link
Owner

Thanks, I also get the same error when calling touch with that filename.

This package has been around for a number of years without that bug having been reported, so I guess it isn't common, but I guess we should implement some kind of fix or workaround for it. I probably won't have time to work on this soon, so patches welcome.

@alphapapa alphapapa self-assigned this Oct 21, 2024
@alphapapa alphapapa added this to the 1.4 milestone Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants