luci: /usr/lib/lua/luci/dispatcher.lua:370: /etc/config/luci seems to be corrupt, unable to find section 'main'

Update to latest master and restore config from backup (~6 month old), got error: /usr/lib/lua/luci/dispatcher.lua:370: /etc/config/luci seems to be corrupt, unable to find section 'main'

#2885, #2799, #2231 - this is not first time.

Workaroud in this message: https://github.com/openwrt/luci/issues/2231#issuecomment-663915276 work for me: if I run rpcd from ssh then error gone.

I dig inside and found that in my backup /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 '*'

This is from default config after reset:

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

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

As you can see:

  1. option socket is different.
  2. if rpcd started without options - if uses proper path to socket, at least GUI works.

Why not remove option socket handling from /etc/config/rpcd and /etc/init.d/rpcd ?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 19 (1 by maintainers)

Most upvoted comments

I have been watching real time graphs in luci and top over ssh. CPU eating luci subprocess quit and now I have this error. Restarting rpcd helped.

I too got this after using the real time graphs.

/var/run/ubus/ubus.sock

I upgraded to 21.02 and this happened. changing /var/run/ubus.sock to /var/run/ubus/ubus.sock fixed it, but isn’t this a bug? I don’t know who is to blame, but either the OpenWRT or Luci needs to fix this, so that users don’t have to do this manually.

/usr/lib/lua/luci/dispatcher.lua:427: /etc/config/luci seems to be corrupt, unable to find section 'main'

Same issue after upgrade from 19.07 to Powered by LuCI openwrt-21.02 branch (git-21.163.64918-ba57ec5) / OpenWrt 21.02.0-rc3 r16172-2aba3e9784:

# 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 '*'

#
# ls -latr /var/run/ubus.sock
ls: /var/run/ubus.sock: No such file or directory
# ls -latr /var/run/ubus/
srw-rw-rw-    1 root     root             0 Jan  1  1970 ubus.sock
drwxr-xr-x    2 root     root            60 Jan  1  1970 .
drwxr-xr-x    7 root     root           420 Jun 26 02:26 ..
# 

Editiing the config file to match the /var/run/ubus/ubus.sock and service rpcd restart fixed the issue for me.

@n-pat Please include release version numbers in your above answer. Thanks.