alphapapa / org-web-tools

View, capture, and archive Web pages in Org-mode
GNU General Public License v3.0
642 stars 34 forks source link

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

Open nico202 opened 5 days ago

nico202 commented 5 days ago

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 commented 5 days ago

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

nico202 commented 5 days ago

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 commented 4 days ago

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

nico202 commented 4 days ago

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 commented 3 days ago

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.