Recent upgrade broke Luci

Hi,

After I upgrade the TP-Link TL-WA901NND v4 from 18.06.5 to 18.06.8 my Luci enviroment broke.

/usr/lib/lua/luci/dispatcher.lua:234: /etc/config/luci seems to be corrupt, unable to find section 'main'
stack traceback:
	[C]: in function 'assert'
	/usr/lib/lua/luci/dispatcher.lua:234: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:127: in function </usr/lib/lua/luci/dispatcher.lua:126>

I can access the router through the command line.

I check this post :

https://forum.openwrt.org/t/upgrade-broke-luci/24026

But without success

Same thing happen after I upgrade the Tp-Link841 v7 router (from 18.06.5 to 18.06.8)

This is due to LUCI now rendering on the client end. If your using a custom theme your best bet is to install the bootstrap theme and set that as your current theme.

The theme your currently using will need the new changes added.

This change seems to be on all branches be it 18.06.xx 19.07 or the master branch.

2 Likes

Sorry, but I'm noob. How can I do this? My installation that I made was default... I don't change anything after the upgrade of version...

I'll investigate tonight.

1 Like

Easiest way is to install WinSCP. Use it to connect to the router with it then go to /etc/config and edit the Luci or system file save the file and reboot.

You said to edit the /etc/config. But to change what for what? @Jow said that he will investigate this.

1 Like

If you look I said go to /etc/config and then edit the Luci or system file that's within that set of folders. You simply change the theme name to bootstrap.

So I've been flashing 18.06.8 on a Xiaomi MIR3G (ramips/mt7621) and on a TP-Link TL-WR1043ND (ar71xx/generic) to rule out target specific issues and LuCI worked as expected. I am unable to observe the crash.

When you say you upgraded, did you reflash with an 18.06.8 image or did you perform opkg upgrades?

Could you locate the file /etc/config/luci-opkg?

Revert router to stock configuration. Have you saved settings during upgrade?

Hi, same issue on tp-link tl-wa801nd v2 ... and yes I've saved settings during upgrade.

So just issue

: firstboot && reboot now

is good to repair broken files?

Atm I'm running a self compiled OpenWRT on a 841nd v5 (with a couple of things removed) and this is the last commit that it's included in my build: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=cc78f934a9466a0ef404bb169cc42680c7501d02
(last commit just before " kernel: bump 4.9 to 4.9.214") without having issues (Luci is happy working and I have over 2 week uptime).

I mostly upgrade between my own builds ~ 1 time each month and I usualy keep the settings (because I'm too lazy to remake them) and I don't remember an issue with Luci crashing.
I did had an issue last year with my builds restarting the router every 2 min (it was stable only if I was clearing all the settings, the smallest config change was triggering the reboot every 2 min) but it looks like Ubuntu messed up something in their kernel, reverting to an older kernel on the build machine generated builds that were working without problems. (dmesg on the build machine was showing a crash related to igpu, something that well was happening ~2015 based on my google searches...). I changed to Manjaro due to this particular issue with Ubuntu (no issues with Manjaro and latest stable kernel, no crash in dmesg on the build machine).

L.E.: I build it from 0.
In the next days I will compile to have the last commit (it was planned anyway) and see if there are any problem.

If you run custom builds, the most likely fix for /usr/lib/lua/luci/dispatcher.lua:234: /etc/config/luci seems to be corrupt, unable to find section 'main' is to manually clean and rebuild rpcd using make package/rpcd/clean world V=s then reflash the resulting image.

But I have installed a plain image

openwrt-18.06.8-ar71xx-tiny-tl-wa801nd-v2-squashfs-sysupgrade.bin

while starting point was a pretty old 15.smtg.somelse

With or without keeping settings?

keeping it

Please provide the contents of /etc/config/rpcd then

...

root@OpenWrt:~# cat /etc/config/rpcd

config login
        option username 'root'
        option password '$p$root'
        list read '\*'
        list write '\*'

root@OpenWrt:~#

It is better to revert to default settings. But you can try to run:

opkg update
opkg upgrade luci

After that locate file /etc/config/luci-opkg, after that delete /etc/config/luci, and rename luci-opkg to luci.