Opkg wget returned 4, but manual wget/curl works

I trying to run opkg install but it seems to hang on the wget command, and eventually it fails with exit code 4.

However I am able to manually download the Packages.gz using either wget or curl.

I really don't see why the wget would fail when invoked by opkg. Any ideas?

Only thing I can think of is not enough space on /tmp/.
Networking should be all right.

Post the actual errors ?

OK it was in fact insufficient space in /tmp/.

The error message is completely deceiving here even at very high verbosty.

root@aldebaran:~# opkg update -V4
ā‹®
Downloading https://downloads.openwrt.org/releases/23.05.3/targets/mediatek/filogic/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/targets/mediatek/filogic/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/base/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/base/Packages.gz

Downloading https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/luci/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/luci/Packages.gz

Downloading https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/routing/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/routing/Packages.gz

Downloading https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/telephony/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/telephony/Packages.gz

hash_table: pkg-hash, 24576 bytes
	n_buckets=1024, n_elements=258, n_collisions=30
	max_bucket_len=3, n_used_buckets=228, ave_bucket_len=1.13
	n_hits=889, n_misses=371
hash_table: file-hash, 24576 bytes
	n_buckets=1024, n_elements=0, n_collisions=0
	max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
	n_hits=0, n_misses=0
hash_table: obs-file-hash, 1536 bytes
	n_buckets=64, n_elements=0, n_collisions=0
	max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
	n_hits=0, n_misses=0
Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/23.05.3/targets/mediatek/filogic/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/base/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/luci/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/routing/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download https://downloads.openwrt.org/releases/23.05.3/packages/aarch64_cortex-a53/telephony/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

I checked that networking is all right by wgeting the package to /dev/null it worked all right so I ruled out networking issues.

So I replaced the wget binary/symlink with my script that logs args ("$@") and noticed that it is saving the result into temp. When I checked df -h /tmpit was full.

2 Likes

TBH the error could be better. E.g. Check your network settings and connectivity and disk space.

1 Like

I was just thinking yesterday, that the error could be self-documenting.

1 Like

It looks like now it's masking inner error.

Also one thing is weird: it returns 4 specifically here which indeed means networking error according to the man page. However I believe I should have gotten 3 File I/O error.

Ah see now, when there is no space left the wget utils does not exit immediately, it appears to just hang (maybe wait for space to be freed). This waiting presumably causes HTTP connection timeout so it does look like a network issue :person_facepalming: .

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.