Closed rozhuk-im closed 3 years ago
Not a LuCI bug. Your config need to be updated.
/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.
/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.
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.
I can confirm that I also got this when using real time graphs of connections (with about 5000 open connections). rpcd seems to crash reproducable. A restart of rpcd helps.
The second problem was a wrong config file (/var/run/ubus.sock), which perhaps happened because of my non-standard upgrade-path. I could solve this by manually adjusting the ubus path in the rpcd config.
I did update by importing a config file from a 19.01 installation into a new 21.02.1 installation. It worked about 10 days until I got the problem when using the real time graphs (which I also used before). Perhaps the rpcd was not restarted, so I noticed the wrong path error very late when it crashed.
From NanoPi-R1 Friendly WRT based on 19.01 OpenWRT (special version by NanoPi from 2021/May/12) to 21.02.1 r16325-88151b8303 official OpenWRT for NanoPi-R1.
@n-pat Please include release version numbers in your above answer. Thanks.
Hi! I have the same issue. To reproduce: login to Luci, and browse the graphs. I also have many connections. Then the corruption occurs. To fix it, I can restart the service over SSH (service rpcd restart), and everything works normal. This problem exists in 21.02.1 (fresh OpenWRT install from stock FW) and 21.02.2. (upgrade) I think it's not a Luci bug. I have not alter any config files when this happened.
Same issue when I flash 19.x from luci on 21.02.2 with router r4ac 100m
I can confirm that I also got this when using real time graphs of connections (with about 5000 open connections). rpcd seems to crash reproducable. A restart of rpcd helps.
I got this same error, after visiting the connections page of real time graphs.
The firmware version:
Firmware Version OpenWrt 21.02.2 r16495-bf0c965af0 / LuCI openwrt-21.02 branch git-22.046.85957-59c3392
I also encountered this symtom after attempting to view the "Connections" real-time graphs, and a restart of rpcd made it work again.
Although there's apparently an underlying issue with rpcd, it seems that the error presented by Luci is bogus - it suggests that the 'main' section is missing from /etc/config/luci, which is, in fact, not the case. From reading above, it appears that this error is also presented when an incorrect rpcd socket path is configured. Apparently this is actually a general "oh crap, something bad happened [when trying to talk to rpcd?]" condition. The bogus error message seems like a Luci bug, albeit a somewhat cosmetic one.
Reporting that I also have the same problem with a large number of connections, crash happens after enabling the DNS resolution in the connections display via LUCI web interface.
@dseven
I also encountered this symtom after attempting to view the "Connections" real-time graphs, and a restart of rpcd made it work again.
Although there's apparently an underlying issue with rpcd, it seems that the error presented by Luci is bogus - it suggests that the 'main' section is missing from /etc/config/luci, which is, in fact, not the case. From reading above, it appears that this error is also presented when an incorrect rpcd socket path is configured. Apparently this is actually a general "oh crap, something bad happened [when trying to talk to rpcd?]" condition. The bogus error message seems like a Luci bug, albeit a somewhat cosmetic one.
Well, maybe in your case it was cosmetis issue but in my case it was a fatal error. The path to the socket was just wrong causing rpcd to exit. But I agree the other situations should be covered a different, more descriptive error message.
I bought a new router yesterday. After uploading the initial ROM to convert stock->OpenWRT, I straightly installed the latest OpenWRT. I am not sure if that counts as an upgrade or not, but this problem randomly happened today. That is, OpenWRT had been working find for hours and when I was browsing the real-time graph tab,s it happened
/usr/lib/lua/luci/dispatcher.lua:431: /etc/config/luci seems to be corrupt, unable to find section 'main'
This time, there was no /var/run/ubus.sock
and /var/run/ubus/ubus.sock
was already there, so I am not sure sure how to solve this.
PS: After browsing other comments, I ran /etc/init.d/rpcd restart
in the SSH terminal and that made the web UI work again.
@HubKing Please include above which OpenWRT version you installed and filname if of imge you flashed.
Please include above which OpenWRT version you installed and filname if of imge you flashed.
Actually, the same error happened again randomly a while after I solved that, so my guess is that it was only a temporary solution and that the same error will keep happening.
Although this was closed long ago this bug is still relevant and reproducible. My first step while debugging was to make sure the ubus path is the right one.
how to reproduce this:
<router ip>/cgi-bin/luci/admin/status/realtime/connections
/usr/lib/lua/luci/dispatcher.lua:431: /etc/config/luci seems to be corrupt, unable to find section 'main'
OpenWrt version: OpenWrt 22.03.4 r20123-38ccc47687 Architecture: ARMv8 Processor rev 4 Target Platform: mediatek/mt7622 Model: Linksys E8450 (UBI)
IMO there should be two separate new issues opened for this problem:
1) RPC dies when there are lots of connections (not a Luci issue, so won't he addressed here) 2) Luci presents a misleading error message when RPC dies (this is a Luci issue, IMO)
You are right, i will open those issues now.
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
This is from default config after reset:
As you can see:
option socket
is different.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
?