single-file-cli icon indicating copy to clipboard operation
single-file-cli copied to clipboard

Fetch Failed Raspberry Pi armv7

Open NathanealV opened this issue 1 year ago • 5 comments

I have the following error when attempting to use single-file-cli on my Raspberry Pi 3B. Seems to be related to #122 but there was no solution from that post. This is running from within a docker container (specifically linkding - see this issue as well).

URL: https://www.wikipedia.org
Stack: TypeError: fetch failed
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///usr/local/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:214:24
    at async retryConnection (file:///usr/local/lib/node_modules/single-file-cli/node_modules/simple-cdp/mod.js:237:16)
    at async Module.getPageData (file:///usr/local/lib/node_modules/single-file-cli/lib/cdp-client.js:49:16)
    at async capturePage (file:///usr/local/lib/node_modules/single-file-cli/single-file-cli-api.js:265:20)
    at async runNextTask (file:///usr/local/lib/node_modules/single-file-cli/single-file-cli-api.js:178:20)
    at async Promise.all (index 0)
    at async capture (file:///usr/local/lib/node_modules/single-file-cli/single-file-cli-api.js:129:2)
    at async run (file:///usr/local/lib/node_modules/single-file-cli/single-file-launcher.js:85:3)

Other OS details: Raspbian 1:6.6.51-1+rpt3 (2024-10-08) armv7l Linux

Any ideas on how to approach this? Thanks

NathanealV avatar Nov 01 '24 07:11 NathanealV

How much RAM and disk space is available on the machine?

gildas-lormeau avatar Nov 05 '24 14:11 gildas-lormeau

I have 1GB RAM and 400+ GB of disk space remaining. Would it be a RAM issue with running chromium?

NathanealV avatar Nov 05 '24 22:11 NathanealV

Indeed, I've seen this kind of error before in this situation. The problem is that the error message issued by Chrome is very generic, so it's not easy to know what's causing the problem.

You might be able to fix the problem by passing some switches to Chrome. For example --enable-low-end-device-mode, --force-device-scale-factor=1, --disable-software-rasterizer (proposed by ChatGPT). You can pass parameters to Chrome with the --browser-arg switch.

Example: single-file https://www.wikipedia.org \ --browser-arg --enable-low-end-device-mode \ --browser-arg --force-device-scale-factor=1

FYI, the complete list of switches is available here: https://peter.sh/experiments/chromium-command-line-switches. Some of them are already passed by single-file.

gildas-lormeau avatar Nov 05 '24 23:11 gildas-lormeau

Thanks for that - I've tried passing those args through. The first time it was successful with only the first 2 (low end device mode and scale factor) but I tried again and it would just continue indefinitely while CPU usage is at 100%. Nothing changed when adding the last software rasterizer flag.

Is there any way to see verbose logs while running the command?

NathanealV avatar Nov 05 '24 23:11 NathanealV

I'm not aware of a way to display detailed logs with Chrome. I'd recommend looking for more info about other switches you might use. AI assistants are pretty good for that, see https://chatgpt.com/share/672d4826-48ac-800e-99c5-5ac8d222bde0 for example.

gildas-lormeau avatar Nov 07 '24 23:11 gildas-lormeau