Bus error while running sysupgrade

Hi there,
I've been using OpenWRT on TP-Link Archer C6 V2 (EU) for the last year and it's been an amazing experience. However, a couple weeks back I ran opkg upgrade (I think I tried upgrading luci) and learnt the hard way that it's not a good idea. After a reboot my router stopped working - the power led was lit, but it seemed like the networks disappeared. Anyway, here's what I've done so far:

  1. I first entered failsafe mode and tried issuing firstboot. After rebooting it seems like all my configs were wiped, but the router is still not functioning correctly. When I navigate to 192.168.1.1 in my browser I'm being redirected to http://192.168.1.1/cgi-bin/luci/, but I'm getting a 502 (Bad Gateway) status with "The process did not produce any response" message :frowning:
  2. My understanding was that I'd need to flash the firmware again, so I tried doing that with sysupgrade, but I'm getting Bus error and not sure where to go from here:
root@OpenWrt:~# sysupgrade -v /tmp/openwrt-19.07.7-ath79-generic-tplink_archer-c6-v2-squashfs-factory.bin
Image metadata not found
Use sysupgrade -F to override this check when downgrading or flashing to vendor firmware
Bus error
Bus error
sh: out of range
Saving config files...
etc/config/adblock
etc/config/dhcp
etc/config/dhcp-opkg
etc/config/dropbear
etc/config/firewall
etc/config/https-dns-proxy
etc/config/luci
etc/config/network
etc/config/rpcd
etc/config/system
etc/config/ubootenv
etc/config/ucitrack
etc/config/uhttpd
etc/config/wireless
etc/crontabs/root
etc/dropbear/authorized_keys
etc/dropbear/dropbear_rsa_host_key
etc/group
etc/hosts
etc/inittab
etc/iproute2/rt_tables
etc/luci-uploads/.placeholder
etc/opkg/keys/0b26f36ae0f4106d
etc/opkg/keys/1035ac73cc4e59e3
etc/opkg/keys/5151f69420c3f508
etc/opkg/keys/72a57f2191b211e0
etc/opkg/keys/792d9d9b39f180dc
etc/opkg/keys/9ef4694208102c43
etc/opkg/keys/b2d571e0880ff617
etc/opkg/keys/b5043e70f9a75cde
etc/opkg/keys/c10b9afab19ee428
etc/opkg/keys/dace9d4df16896bf
etc/opkg/keys/dd6de0d06bbd3d85
etc/opkg/keys/f94b9dd6febac963
etc/passwd
etc/profile
etc/rc.local
etc/shadow
etc/shells
etc/sysctl.conf
Bus error
Commencing upgrade. Closing all shell sessions.
Bus error

I'm not exactly sure where to go from here, I decided I'm gonna ask here first before I break it even more. Any help would be appreciated, I'll also be happy to provide any other details that may be useful. Thanks!

Try doing a TFTP recovery.

The "factory" images are meant to be installed over the original firmware. To upgrade or reinstall over OpenWrt, use the "sysupgrade" images.

3 Likes

@eduperez sure, thanks. I'll keep that in mind for the future, maybe you just saved me from breaking something again :wink: (Though naturally in this case this makes no difference since I can't sysupgrade anything :/)
@frollic I just tried the tftp approach, but no luck.

Here's what I did:

  1. Started a tftp server on my raspberry pi using the following script:
#/bin/bash
USER=diglet
IFNAME=eth0
ip address flush dev $IFNAME
ip address add 192.168.0.66/24 dev $IFNAME
ip link set $IFNAME up
dnsmasq -i $IFNAME --dhcp-range=192.168.0.80,192.168.0.150 \
        --dhcp-boot=ArcherC6v2_tp_recovery.bin \
        --enable-tftp --tftp-root=/home/$USER/openwrt -d -u $USER -p0 -K --log-dhcp --bootp-dynamic
  1. Ran tcpdump to see what's happening on port 69
sudo tcpdump port 69 -v
[sudo] password for diglet:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
20:25:26.515545 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto UDP (17), length 73)
    192.168.0.86.3524 > 192.168.0.66.tftp:  45 RRQ "ArcherC6v2_tp_recovery.bin" octet timeout 5
  1. Connected raspberry pi with my router using a 10/100 switch (this one exactly)
  2. Followed the tftp recovery instructions for the router, here are the outputs from both of the processes:
  • tcpdump:
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
20:25:26.515545 IP (tos 0x0, ttl 255, id 0, offset 0, flags [DF], proto UDP (17), length 73)
    192.168.0.86.3524 > 192.168.0.66.tftp:  45 RRQ "ArcherC6v2_tp_recovery.bin" octet timeout 5
  • tftp server:
dnsmasq: started, version 2.80 DNS disabled
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
dnsmasq-dhcp: DHCP, IP range 192.168.0.80 -- 192.168.0.150, lease time 1h
dnsmasq-tftp: TFTP root is /home/diglet/openwrt
dnsmasq-tftp: sent /home/diglet/openwrt/ArcherC6v2_tp_recovery.bin to 192.168.0.86

Interestingly enough, it took around 3-5 seconds between the tcpdump message and tftp message, so I'm assuming this means that the binary is uploaded to the router. Watching the LED on the router, it seems like it proceeds to boot 'normally' as the power LED is blinking slowly and then stops. I can ssh into the router and the 'bus error' issue is still there. So I'm guessing the router rejects the binary for some reason? Is there a way for me to learn what the reason could be? Would trying out earlier openwrt binaries/oem make sense?

Side note: it seems like every time I boot the router now, it changes its rsa keys since I'm seeing the following message and need to manually remove the stale host from ~/.ssh/known_hosts:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:X/uXCH8I7ookZS22qoWsaUgBwoi/Mb54u6aOdkqYX78.
Please contact your system administrator.
Add correct host key in /Users/<me>/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/<me>/.ssh/known_hosts:42
RSA host key for 192.168.1.1 has changed and you have requested strict checking.
Host key verification failed.

Which image did you use for the TFTP transfer?

1 Like

I used https://downloads.openwrt.org/releases/19.07.7/targets/ath79/generic/openwrt-19.07.7-ath79-generic-tplink_archer-c6-v2-squashfs-factory.bin

It seems I can run opkg and other commands fine when in fail-safe mode. Would it make sense to try sysupgrade while in fail-safe mode then?

You could.

Another option would be to return to stock, and start all over with the openwrt installation.

1 Like

By reverting to stock do you mean serving the latest firmware from oem site via tftp? Sure, I'll try that first since it feels safer. If that doesn't work I'll try sysupgrade with https://downloads.openwrt.org/releases/19.07.7/targets/ath79/generic/openwrt-19.07.7-ath79-generic-tplink_archer-c6-v2-squashfs-sysupgrade.bin as suggested by eduperez.
I'll let you know how it goes (and thanks a lot for all the help already!).

Make sure you Google that, so you don't accidentally brick it.
Since there's no return to stock section in the wiki.

1 Like

Alright, the tftp with the stock images did not work, the binaries were rejected.
However, running sysupgrade in fail-safe mode went smooth and I'm running a fresh new openwrt now :partying_face:

root@(none):~# sysupgrade -v /tmp/openwrt-19.07.7-ath79-generic-tplink_archer-c6-v2-squashfs-
sysupgrade.bin
Saving config files...
etc/config/dhcp
etc/config/dropbear
etc/config/firewall
etc/config/luci
etc/config/rpcd
etc/config/ucitrack
etc/config/uhttpd
etc/dropbear/dropbear_rsa_host_key
etc/group
etc/hosts
etc/inittab
etc/luci-uploads/.placeholder
etc/opkg/keys/0b26f36ae0f4106d
etc/opkg/keys/1035ac73cc4e59e3
etc/opkg/keys/5151f69420c3f508
etc/opkg/keys/72a57f2191b211e0
etc/opkg/keys/792d9d9b39f180dc
etc/opkg/keys/9ef4694208102c43
etc/opkg/keys/b2d571e0880ff617
etc/opkg/keys/b5043e70f9a75cde
etc/opkg/keys/c10b9afab19ee428
etc/opkg/keys/dace9d4df16896bf
etc/opkg/keys/dd6de0d06bbd3d85
etc/opkg/keys/f94b9dd6febac963
etc/passwd
etc/profile
etc/rc.local
etc/shadow
etc/shells
etc/sysctl.conf
Commencing upgrade. Closing all shell sessions.
root@(none):~# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

Thank you so much @frollic, can't tell you how much this issue bugged me over the last couple of weeks!
And thank you @eduperez for being five steps ahead of me and preventing me from sysupgrading the wrong file :smiley:

1 Like

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