Recent upgrade broke Luci

Ok everything looks correct other then the languages section.

Under languages insert

option en 'english'

See if that works.

This is what my file looks like


config core 'main'
	option resourcebase '/luci-static/resources'
	option lang 'auto'
	option mediaurlbase '/luci-static/opentomato'

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'
	option en 'English'

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

config internal 'ccache'
	option enable '0'

config internal 'themes'
	option Bootstrap '/luci-static/bootstrap'
	option OpenTomato '/luci-static/opentomato'

config internal 'apply'
	option rollback '30'
	option holdoff '4'
	option timeout '5'
	option display '1.5'

config internal 'diag'
	option dns 'google.co.uk'
	option ping 'google.co.uk'
	option route 'google.co.uk'

I compiled OpenWRT for my 841nd v5 (latest commit for 18.06) and updated it (from commit https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=cc78f934a9466a0ef404bb169cc42680c7501d02 ) by keeping the settings and Luci is working fine.
I have 2 hours uptime and I see no problems at all.

I only have a couple of things removed compared to a default config and luci added.

I'm unable to replicate the issue and I didn't had this problem when I monthly updated it with my own builds.

I have another router(Tp-link 840 v2) that I made the same processes(flash from 18.06.5 to 18.06.8) but that worked very well ...

Done!

 OpenWrt 18.06.8, r7989-82fbd85747
 -----------------------------------------------------
root@LEDE:~# vi /etc/config/luci
root@LEDE:~# vi /etc/config/luci
root@LEDE:~# cat /etc/config/luci

config core 'main'
        option lang 'auto'
        option mediaurlbase '/luci-static/bootstrap'
        option resourcebase '/luci-static/resources'

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'
        option en 'english'

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

config internal 'ccache'
        option enable '1'

config internal 'themes'
        option Bootstrap '/luci-static/bootstrap'

config internal 'apply'
        option rollback '30'
        option holdoff '4'
        option timeout '5'
        option display '1.5'

root@LEDE:~#

But,

/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>

If you haven't any ideas I will close the topic and put the solution is to run "firstboot"...

I have no more idea's or solutions you may continue with the firstboot methord.

1 Like

So to resume:

The problem

After I flash(I checked the option to keep config berore I flash it...) the my 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>

The Solution

So the only solution founded was connect through Putty(SSH) with user and password.

And follow type this commands:

root@LEDE:~# mount_root
root@LEDE:~# firstboot
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock3 is mounted as /overlay, only erasing files
root@LEDE:~# reboot -f

After this the Luci enviroment will work but you will need setup the router again.

Thanks everyone for the help!

1 Like

Add following lines to /etc/config/rpcd

config rpcd
option socket /var/run/ubus.sock
option timeout 30

1 Like

Same issue today with TL-WR741nd v1 - upgrade was from v. 18.06.6 to 18.06.8 keeping the settings as I always do (countless times so far) but Luci just throws this message:

/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'm afraid to upgrade other 4 TP-Link routers (different models) that currently use 18.06.6

Some configuration seemingly causes the problem. So far I couldn't reproduce it with naive testing. Could you share your complete uci show output? Preferably via PM, make sure to redact any secrets.

I've sent you the output via PM.
Can I downgrade to a previous version via SSH.

1 Like

Yes, while connected via SSH perform the following commands. Make sure to pick the right sysupgrade image for your board from https://archive.openwrt.org/releases/18.06.7/targets/ar71xx/tiny/ and replace https:// with http:// when copy pasting the link.

cd /tmp
wget http://archive.openwrt.org/releases/18.06.7/targets/ar71xx/tiny/openwrt-18.06.7-ar71xx-tiny-tl-wa901nd-v1-squashfs-sysupgrade.bin
sysupgrade openwrt-18.06.7-ar71xx-tiny-tl-wa901nd-v1-squashfs-sysupgrade.bin
1 Like

@jow
Thanks. Will the above commands preserve the settings or they will be reset to default ones.
Did you get anything useful from the data I've sent you.

The above commands should preserve your settings.

Unfortunately not, I am still not able to reproduce the problem, even when restoring your uci configs. Either the issue is model specific, or the problem is introduced by non-uci configuration.

@jow
I've just downgraded to 18.06.7 - Luci is OK.
Decided to play a little. Once again upgraded to 18.06.8 (this time from 18.06.7) - Luci is broken with same message.
Then downgraded to 18.06.7 - for now will keep that version.

In the reply to @jow - first part of the post I presented the fix that worked for me:

I've upgraded two other routers TP-Link TL-WR841N/ND v7 and v8 to 18.06.8 - Luci is OK.

Just to add, I have a TP-Link TL-WA901N v3 and I'm seeing the same problem.

I also tried the forum posting https://forum.openwrt.org/t/upgrade-broke-luci/24026, but also without success

Regressing to 18.06.7 allows me to recover, but I did have a heart attack when 18.06.8 failed :wink:

As someone else mentioned, I have always had successful upgrades, but took a configuration backup - just in case.

If I have some time in the next few days, when everyone isn't using the wifi, then I can investigate further - but I just thought that I would add a "me too" post here

Thanks!

Hi,

If nothing works flash the old version with the option uncheck "keep the config".

Setup the router and wait that one new version fixed this problem...

thank you very much! downgrade via SSH. Saved my life! kkk
I am using the 941ND tplink

I can confirm this bug on these devices:

TL-WR940N v4
TL-WA801ND v2
TL-WR741ND v1

All upgraded from 18.06.7 to 18.06.8 (sysupgrade via Luci while keeping settings), which broke Luci.

Fixed it by setting back to factory defaults, then reconfigured. Curiously, to exactly the same settings as before the upgrade, which then worked flawlessly.