Recover corrupted Luci after power failure

Hello all...

Yesterday there were problems with electricity in a company where I support them and in one of the AP's, Luci corrupted...

In the post Recovery broken luci - Installing and Using OpenWrt - OpenWrt Forum I had previously managed to recover Luci successfully and with the help of colleagues, but this time, I tried to apply the same solution and was unsuccessful.

Interesting to say that the AP in question restarted and works correctly... only Luci was corrupted...

I tried to completely remove Luci with the command "opkg remove luci* --force-depends - works well..

After, i try opkg install luci luci-compat, also works well, but not loads Luci..

Any suggestions before reinstall all in this router, which in fact only acts as an AP?

Interestingly, we have other APs in the company, but only this one had problems.

Cheers!

Well doing an in-place sysupgrade of the same version should either:

  • fix the issue
    or
  • identify it may be a config that's actually corrupted

post the output of

service uhttpd  status
cat /etc/config/luci
cat /etc/config/uhttpd
opkg list-installed

and what exactly the browser shows when trying to log in router's page?

1 Like

Good idea!

I will try now!

OK, let´s go!!

root@toth:~# service uhttpd  status
running
root@toth:~#
root@toth:~# cat /etc/config/luci
config core main
        option lang auto
        option mediaurlbase /luci-static/bootstrap
        option resourcebase /luci-static/resources
        option ubuspath /ubus/

config extern flash_keep
        option uci              "/etc/config/"
        option dropbear "/etc/dropbear/"
        option openvpn  "/etc/openvpn/"
        option passwd   "/etc/passwd"
        option opkg             "/etc/opkg.conf"
        option firewall "/etc/firewall.user"
        option uploads  "/lib/uci/upload/"

config internal languages

config internal sauth
        option sessionpath "/tmp/luci-sessions"
        option sessiontime 3600

config internal ccache
        option enable 1

config internal themes

config internal apply
        option rollback 90
        option holdoff 4
        option timeout 5
        option display 1.5
root@toth:~#
root@toth:~# cat /etc/config/uhttpd

config uhttpd 'main'
        list listen_http '0.0.0.0:80'
        list listen_http '[::]:80'
        list listen_https '0.0.0.0:443'
        list listen_https '[::]:443'
        option redirect_https '0'
        option home '/www'
        option rfc1918_filter '1'
        option max_requests '3'
        option max_connections '100'
        option cert '/etc/uhttpd.crt'
        option key '/etc/uhttpd.key'
        option cgi_prefix '/cgi-bin'
        list lua_prefix '/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua'
        option script_timeout '60'
        option network_timeout '30'
        option http_keepalive '20'
        option tcp_keepalive '1'
        option ubus_prefix '/ubus'
        list ucode_prefix '/cgi-bin/luci=/usr/share/ucode/luci/uhttpd.uc'

config cert 'defaults'
        option days '730'
        option key_type 'ec'
        option bits '2048'
        option ec_curve 'P-256'
        option country 'ZZ'
        option state 'Somewhere'
        option location 'Unknown'
        option commonname 'OpenWrt'

root@toth:~#
root@toth:~# opkg list-installed
ath10k-board-qca988x - 20230804-1
ath10k-firmware-qca988x-ct - 2020-11-08-1
base-files - 1545-r23497-6637af95aa
block-mount - 2023-02-28-bfe882d5-1
busybox - 1.36.1-1
ca-bundle - 20230311-1
cgi-io - 2022-08-10-901b0f04-21
collectd - 5.12.0-49
collectd-mod-conntrack - 5.12.0-49
collectd-mod-cpu - 5.12.0-49
collectd-mod-cpufreq - 5.12.0-49
collectd-mod-df - 5.12.0-49
collectd-mod-dhcpleases - 5.12.0-49
collectd-mod-disk - 5.12.0-49
collectd-mod-dns - 5.12.0-49
collectd-mod-entropy - 5.12.0-49
collectd-mod-interface - 5.12.0-49
collectd-mod-ipstatistics - 5.12.0-49
collectd-mod-irq - 5.12.0-49
collectd-mod-iwinfo - 5.12.0-49
collectd-mod-load - 5.12.0-49
collectd-mod-memory - 5.12.0-49
collectd-mod-network - 5.12.0-49
collectd-mod-processes - 5.12.0-49
collectd-mod-rrdtool - 5.12.0-49
collectd-mod-sensors - 5.12.0-49
collectd-mod-snmp6 - 5.12.0-49
collectd-mod-tcpconns - 5.12.0-49
collectd-mod-thermal - 5.12.0-49
collectd-mod-uptime - 5.12.0-49
curl - 8.7.1-r1
dnsmasq - 2.90-2
dropbear - 2022.82-5
e2fsprogs - 1.47.0-2
firewall4 - 2023-09-01-598d9fbb-1
fstools - 2023-02-28-bfe882d5-1
fwtool - 2019-11-12-8f7fe925-1
getrandom - 2022-08-13-4c7b720b-2
hostapd-common - 2023-09-08-e5ccbfc6-8
iw - 5.19-1
iwinfo - 2023-07-01-ca79f641-1
jansson4 - 2.14-3
jshn - 2023-05-23-75a3b870-1
jsonfilter - 2024-01-23-594cfa86-1
kernel - 5.15.134-1-db5fae317c7dec03ba9a83c32ababa81
kmod-ath - 5.15.134+6.1.24-3
kmod-ath10k-ct - 5.15.134+2022-05-13-f808496f-5
kmod-ath9k - 5.15.134+6.1.24-3
kmod-ath9k-common - 5.15.134+6.1.24-3
kmod-cfg80211 - 5.15.134+6.1.24-3
kmod-crypto-acompress - 5.15.134-1
kmod-crypto-aead - 5.15.134-1
kmod-crypto-ccm - 5.15.134-1
kmod-crypto-cmac - 5.15.134-1
kmod-crypto-crc32c - 5.15.134-1
kmod-crypto-ctr - 5.15.134-1
kmod-crypto-gcm - 5.15.134-1
kmod-crypto-gf128 - 5.15.134-1
kmod-crypto-ghash - 5.15.134-1
kmod-crypto-hash - 5.15.134-1
kmod-crypto-hmac - 5.15.134-1
kmod-crypto-manager - 5.15.134-1
kmod-crypto-null - 5.15.134-1
kmod-crypto-rng - 5.15.134-1
kmod-crypto-seqiv - 5.15.134-1
kmod-crypto-sha512 - 5.15.134-1
kmod-fs-ext4 - 5.15.134-1
kmod-gpio-button-hotplug - 5.15.134-3
kmod-hwmon-core - 5.15.134-1
kmod-lib-crc-ccitt - 5.15.134-1
kmod-lib-crc16 - 5.15.134-1
kmod-lib-crc32c - 5.15.134-1
kmod-lib-lzo - 5.15.134-1
kmod-mac80211 - 5.15.134+6.1.24-3
kmod-nf-conntrack - 5.15.134-1
kmod-nf-conntrack6 - 5.15.134-1
kmod-nf-flow - 5.15.134-1
kmod-nf-log - 5.15.134-1
kmod-nf-log6 - 5.15.134-1
kmod-nf-nat - 5.15.134-1
kmod-nf-reject - 5.15.134-1
kmod-nf-reject6 - 5.15.134-1
kmod-nfnetlink - 5.15.134-1
kmod-nft-core - 5.15.134-1
kmod-nft-fib - 5.15.134-1
kmod-nft-nat - 5.15.134-1
kmod-nft-offload - 5.15.134-1
kmod-nls-base - 5.15.134-1
kmod-phy-ath79-usb - 5.15.134-1
kmod-ppp - 5.15.134-1
kmod-pppoe - 5.15.134-1
kmod-pppox - 5.15.134-1
kmod-random-core - 5.15.134-1
kmod-scsi-core - 5.15.134-1
kmod-slhc - 5.15.134-1
kmod-usb-core - 5.15.134-1
kmod-usb-ehci - 5.15.134-1
kmod-usb-ledtrig-usbport - 5.15.134-1
kmod-usb-storage - 5.15.134-1
kmod-usb2 - 5.15.134-1
libatomic1 - 12.3.0-4
libblkid1 - 2.39-2
libblobmsg-json20230523 - 2023-05-23-75a3b870-1
libc - 1.2.4-4
libcomerr0 - 1.47.0-2
libcurl4 - 8.7.1-r1
libevdev - 1.13.0-1
libext2fs2 - 1.47.0-2
libgcc1 - 12.3.0-4
libiwinfo-data - 2023-07-01-ca79f641-1
libiwinfo20230701 - 2023-07-01-ca79f641-1
libjson-c5 - 0.16-3
libjson-script20230523 - 2023-05-23-75a3b870-1
libltdl7 - 2.4.7-1
liblua5.1.5 - 5.1.5-11
liblucihttp-lua - 2023-03-15-9b5b683f-1
liblucihttp-ucode - 2023-03-15-9b5b683f-1
liblucihttp0 - 2023-03-15-9b5b683f-1
libmbedtls12 - 2.28.8-1
libmnl0 - 1.0.5-1
libncurses6 - 6.4-2
libnftnl11 - 1.2.6-1
libnghttp2-14 - 1.57.0-1
libnl-tiny1 - 2023-07-27-bc92a280-1
libopenssl3 - 3.0.14-2
libparted - 3.6-1
libpcap1 - 1.10.4-1
libpthread - 1.2.4-4
libreadline8 - 8.2-1
librrd1 - 1.0.50-5
librt - 1.2.4-4
libsensors5 - 3.6.0-1
libss2 - 1.47.0-2
libsysfs2 - 2.1.0-4
libubox20230523 - 2023-05-23-75a3b870-1
libubus-lua - 2023-06-05-f787c97b-1
libubus20230605 - 2023-06-05-f787c97b-1
libuci20130104 - 2023-08-10-5781664d-1
libuclient20201210 - 2023-04-13-007d9454-1
libucode20220812 - 2023-06-06-c7d84aae-1
libucode20230711 - 2024-07-11-1a8a0bcf-1
libudev-zero - 1.0.1-1
libustream-mbedtls20201210 - 2023-02-25-498f6e26-1
libuuid1 - 2.39-2
lm-sensors - 3.6.0-1
logd - 2022-08-13-4c7b720b-2
lua - 5.1.5-11
luci-base - git-24.346.66847-1bb28ba
luci-compat - git-24.346.66847-1bb28ba
luci-lib-base - git-24.346.66847-1bb28ba
luci-lib-ip - git-24.346.66847-1bb28ba
luci-lib-jsonc - git-24.346.66847-1bb28ba
luci-lib-nixio - git-24.346.66847-1bb28ba
luci-lua-runtime - git-24.346.66847-1bb28ba
mtd - 26
netifd - 2024-01-04-c18cc79d-2
nftables-json - 1.0.8-1
odhcp6c - 2023-05-12-bcd28363-20
odhcpd-ipv6only - 2023-10-24-d8118f6e-1
openwrt-keyring - 2022-03-25-62471e69-2
opkg - 2022-02-24-d038e5b6-2
parted - 3.6-1
ppp - 2.4.9.git-2021-01-04-4
ppp-mod-pppoe - 2.4.9.git-2021-01-04-4
procd - 2023-06-25-2db83655-2
procd-seccomp - 2023-06-25-2db83655-2
procd-ujail - 2023-06-25-2db83655-2
px5g-mbedtls - 10
rng-tools - 6.15-2
rpcd - 2023-07-01-c07ab2f9-1
rpcd-mod-file - 2023-07-01-c07ab2f9-1
rpcd-mod-iwinfo - 2023-07-01-c07ab2f9-1
rpcd-mod-luci - 20240305-1
rpcd-mod-rrdns - 20170710
rpcd-mod-ucode - 2023-07-01-c07ab2f9-1
rrdtool1 - 1.0.50-5
swconfig - 12
sysfsutils - 2.1.0-4
terminfo - 6.4-2
uboot-envtools - 2023.04-1
ubox - 2022-08-13-4c7b720b-2
ubus - 2023-06-05-f787c97b-1
ubusd - 2023-06-05-f787c97b-1
uci - 2023-08-10-5781664d-1
uclient-fetch - 2023-04-13-007d9454-1
ucode - 2024-07-11-1a8a0bcf-1
ucode-mod-fs - 2024-07-11-1a8a0bcf-1
ucode-mod-html - 1
ucode-mod-lua - 1
ucode-mod-math - 2024-07-11-1a8a0bcf-1
ucode-mod-nl80211 - 2024-07-11-1a8a0bcf-1
ucode-mod-rtnl - 2024-07-11-1a8a0bcf-1
ucode-mod-ubus - 2024-07-11-1a8a0bcf-1
ucode-mod-uci - 2024-07-11-1a8a0bcf-1
ucode-mod-uloop - 2024-07-11-1a8a0bcf-1
uhttpd - 2023-06-25-34a8a74d-2
uhttpd-mod-ubus - 2023-06-25-34a8a74d-2
urandom-seed - 3
urngd - 2023-11-01-44365eb1-1
usign - 2020-05-23-f1f65026-1
wireless-regdb - 2024.07.04-1
wpad-mbedtls - 2023-09-08-e5ccbfc6-8
zlib - 1.2.13-1
root@toth:~#

What are the specific symptoms of the corruption you’re experiencing?

And what version of OpenWrt is in use and on what device:

ubus call system board 

Hello friend...

The router is a TP-Link Archer C7, V4... only Luci is broken... the rest, works well...
Running on MS Edge, but, in any browser, the problem is same...

type or paste code hereroot@toth:~# ubus call system board
{
        "kernel": "5.15.134",
        "hostname": "toth",
        "system": "Qualcomm Atheros QCA956X ver 1 rev 0",
        "model": "TP-Link Archer C7 v4",
        "board_name": "tplink,archer-c7-v4",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.0",
                "revision": "r23497-6637af95aa",
                "target": "ath79/generic",
                "description": "OpenWrt 23.05.0 r23497-6637af95aa"
        }
}
root@toth:~#

I'd use this opportunity to upgrade to 23.05.5. The upgrade alone should fix the issue, but to determine if there is something wrong with your config, the best option is to:

  1. Make a backup of your configuration. You can create a backup using ssh and the command-line.
  2. Upgrade to 23.05.5 without keeping settings: This will also need to be done via CLI because you don't have a working LuCI:
cd /tmp
wget https://downloads.openwrt.org/releases/23.05.5/targets/ath79/generic/openwrt-23.05.5-ath79-generic-tplink_archer-c7-v4-squashfs-sysupgrade.bin
sysupgrade -n /tmp/openwrt-23.05.5-ath79-generic-tplink_archer-c7-v4-squashfs-sysupgrade.bin
  1. Observe that the device is working properly with the fresh/default installation
  2. Restore the config and test again.

try to install the following packages using opkg update and then opkg install <package-name>

luci-theme-bootstrap
luci-light
luci-ssl
luci

and reboot it

(installing first two should work)

1 Like

Wow, thanks a lot!!!

It worked great installing just the first 3 packages...

luci-theme-bootstrap
luci-light
luci-ssl

It was not necessary to restart the router!