Luci is not working on opal

Luci has stopped working on Opal, I didnt do any update or whatever.

When I open http://192.168.0.1/cgi-bin/luci
I get this:

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

You should SSH into your router and check the named file.

Strange! Someone might broken into your modem and messed it up!

Anyway I would advise you to reset all settings or better reflashing it UNLESS you have some reasons not to do so.

I dont want to setup everything again (I installed also print server and some other packages), gl.inet admin area works normally byt why luci doesnt work?

Then reinstall LuCi packages, or dig into the logs for the cause of such error.

Update:

This might help:

 cat /etc/config/luci

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

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'
        option Bootstrap '/luci-static/bootstrap'

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

config internal 'diag'
        option dns 'openwrt.org'
        option ping 'openwrt.org'
        option route 'openwrt.org'

config ifstate
        option interface 'wwan'
        option ifname 'radio1.network3'
        option bridge 'false'


check the rpcd config file as hinted in the link I provided.

And SSH into the box and restart rpcd service:
service rpcd restart

Restarted, but not sure what should I do that that rpcd config

root@openwrt:~# service rpcd restart
root@openwrt:~#
root@openwrt:~# option socket /var/run/ubus.sock
-ash: option: not found
root@openwrt:~# cat /var/run/ubus.sock
cat: can't open '/var/run/ubus.sock': No such device or address
root@openwrt:~# cat /var/run/ubus/ubus.sock
cat: can't open '/var/run/ubus/ubus.sock': No such file or directory
root@openwrt:~# cp /rom/etc/config/rpcd /etc/config/rpcd
cp: can't stat '/rom/etc/config/rpcd': No such file or directory

Please run and show the output:
cat /etc/config/rpcd

  • Which packages have you installed recently?
  • How long have you been running the modem without firmware update?
  • Have you restored your configurations/settings recently?

The problem is not with luci but rpcd, although the error message is misleading and confusing!

I am suspecting that one of the packages he installed for the print server messed up his rpcd. It happened before with me and drove me nuts when I installed grep with opkg!

1 Like

root@openwrt:~# cat /etc/config/rpcd
config rpcd
option socket /var/run/ubus.sock
option timeout 30

config login
option username ‘root’
option password ‘$p$root’
list read ‘
list write '

config login
option username ‘sfroot’
option password ‘$p$sfroot’
list read ‘
list write '

root@openwrt:~#

  • Which packages have you installed recently?
    GL-AR750S as print server - #8 by satheemuah I followed this guide
    Luci was working after I installed it, I configured p910nd Printer server on it and firewall on gl.inet admin area. If I remember correctly, after router reboot the next day after the installation of print server, I could access Luci normally.

  • How long have you been running the modem without firmware update?
    for like 2 months, I don’t remember exactly, I haven’t updated firmware recently.

  • Have you restored your configurations/settings recently?
    No

Can you comment out these lines by adding # at the beginning of each line then restart rpcd using the command I gave you before and test.

Like this?

Rebooted rpcd and router after editing that file but still the same

Actually, I removed the # comments on those lines, rebooted router and now luci works. I will keep you updated if it stops working again. Not sure why it wasnt working before.

opkg update; opkg install --force-reinstall luci