Opkg update Failed ; wget returned 3 ; but wget works if manually typed!

Hi all,

I would think it's a filesystem issue rather than a network issue, but well:

I set up my router as a dumb AP. No issue so far.

But when doing opkg update, drama starts:

opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.2/targets/mvebu/cortexa9/packag
es/Packages.gz, wget returned 3

Code 3 is "File I/O"

But if as root, I do:

wget https://downloads.openwrt.org/releases/22.03.2/targets/mvebu/cortexa9/packages/Packages.gz

Then it works, I have now the file on my system!

I have an external hard-drive, and use it for extra-system space (it hosts an Ad Guard Home). I assume opkg attempts to download in a space where it can't (??). What would that be, and how do I move that to the external driver?

Thanks very much!

let's see your configuration:

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'xxxx:xxxx:xxxx::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config device
        option name 'lan1'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config device
        option name 'lan2'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config device
        option name 'lan3'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config device
        option name 'lan4'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.2'
        list dns '192.168.1.1'
        option gateway '192.168.1.1'

config device
        option name 'wan'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'
        option auto '0'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'
        option auto '0'
        option reqaddress 'try'
        option reqprefix 'auto'

cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'soc/soc:pcie@82000000/pci0000:00/0000:00:02.0/0000:02:00.0'
        option band '2g'
        option country 'US'
        option cell_density '0'
        option channel '8'
        option txpower '30'
        option htmode 'HT40'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option macaddr 'xx:xx:xx:xx:xx:xx'
        option encryption 'psk2'
        option key 'xxxxxxxxx'
        option ssid 'AP_ROUTER_SSID'
        option disassoc_low_ack '0'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'soc/soc:pcie@82000000/pci0000:00/0000:00:03.0/0000:03:00.0'
        option band '5g'
        option htmode 'VHT80'
        option country 'US'
        option cell_density '0'
        option channel '52'
        option txpower '24'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option macaddr 'xx:xx:xx:xx:xx:xx'
        option encryption 'psk2'
        option key 'xxxxxxxxx'
        option ssid 'AP_ROUTER_SSID'

cat /etc/config/dhcp

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'soc/soc:pcie@82000000/pci0000:00/0000:00:02.0/0000:02:00.0'
        option band '2g'
        option country 'US'
        option cell_density '0'
        option channel '8'
        option txpower '30'
        option htmode 'HT40'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option macaddr 'xx:xx:xx:xx:xx:xx'
        option encryption 'psk2'
        option key 'xxxxxxxxx'
        option ssid 'AP_ROUTER_SSID'
        option disassoc_low_ack '0'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'soc/soc:pcie@82000000/pci0000:00/0000:00:03.0/0000:03:00.0'
        option band '5g'
        option htmode 'VHT80'
        option country 'US'
        option cell_density '0'
        option channel '52'
        option txpower '24'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option macaddr 'xx:xx:xx:xx:xx:xx'
        option encryption 'psk2'
        option key 'xxxxxxxxx'
        option ssid 'AP_ROUTER_SSID'

cat /etc/config/firewall

type oconfig defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

config zone
        option name             lan
        list   network          'lan'
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             wan
        list   network          'wan'
        list   network          'wan6'
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
config rule
        option name             Allow-Ping
        option src              wan
        option proto            icmp
        option icmp_type        echo-request
        option family           ipv4
        option target           ACCEPT

config rule
        option name             Allow-IGMP
        option src              wan
        option proto            igmp
        option family           ipv4
        option target           ACCEPT

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        option dest_port        546
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-MLD
        option src              wan
        option proto            icmp
        option src_ip           fe80::/10
        list icmp_type          '130/0'
        list icmp_type          '131/0'
        list icmp_type          '132/0'
        list icmp_type          '143/0'
        option family           ipv6
        option target           ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Input
        option src              wan
        option proto    icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        list icmp_type          router-solicitation
        list icmp_type          neighbour-solicitation
        list icmp_type          router-advertisement
        list icmp_type          neighbour-advertisement
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
        option name             Allow-ICMPv6-Forward
        option src              wan
        option dest             *
        option proto            icmp
        list icmp_type          echo-request
        list icmp_type          echo-reply
        list icmp_type          destination-unreachable
        list icmp_type          packet-too-big
        list icmp_type          time-exceeded
        list icmp_type          bad-header
        list icmp_type          unknown-header-type
        option limit            1000/sec
        option family           ipv6
        option target           ACCEPT

config rule
        option name             Allow-IPSec-ESP
        option src              wan
        option dest             lan
        option proto            esp
        option target           ACCEPT

config rule
        option name             Allow-ISAKMP
        option src              wan
        option dest             lan
        option dest_port        500
        option proto            udp
        option target           ACCEPTr paste code here

I skipped the rest of the file that's all commented out.

Ok.... everything looks fine there.

What is the output of:

ubus call system board
free
df -h

ubus call system board

type or{
        "kernel": "5.10.146",
        "hostname": "routername",
        "system": "ARMv7 Processor rev 2 (v7l)",
        "model": "Linksys WRT1900AC v1",
        "board_name": "linksys,wrt1900ac-v1",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "22.03.2",
                "revision": "r19803-9a599fee93",
                "target": "mvebu/cortexa9",
                "description": "OpenWrt 22.03.2 r19803-9a599fee93"
        }
}

free

              total        used        free      shared  buff/cache   available
Mem:         248316       90560       24264       90916      133492       20992
Swap:        262140       47692      214448

df -h

Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.5M      3.5M         0 100% /rom
tmpfs                   121.2M    121.2M         0 100% /tmp
/dev/sda4                 2.6G    873.2M      1.6G  34% /overlay
overlayfs:/overlay        2.6G    873.2M      1.6G  34% /
ubi1:syscfg              30.8M    292.0K     28.9M   1% /tmp/syscfg
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda2               724.4G    563.8G    123.8G  82% /mnt/sda2

your tmpfs is completely full and you have swap that is using quite a bit of memory, too. What is running on this device?

3 Likes

Yes the zero free on /tmp is the problem. You've probably storing large log files on /tmp.

The files on /tmp also tie up half of the RAM, making swapping necessary.

3 Likes

Aaaaah!
I run AdGuardHome, and indeed, that's what's filling /tmp!
I think I need to move things around...

Thanks!

Yeah, that will do it. Moving files out of tmp (or changing the maximum size of logs and such that are using that space) should fix it.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

My /var was a link to /tmp, itself in the RAM.

cp the whole thing to a /var1, deleted /var and moved /var1 to /var in a single command line, reboot, and now all is fine!

Thanks very much!

This is normal.

The real question is why your var (tmp) was filling up. What was being stored there?

It was the AdguardHome logs.

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