After fiddling around in LuCI (OpenWrt 23.05.0-rc3) I managed to get myself to the point where I would see the login screen but immediately after logging in, received this error:
Error
Unhandled exception during request dispatching
module 'luci.ucodebridge' not found:
no field package.preload['luci.ucodebridge']
no file './luci/ucodebridge.lua'
no file '/usr/share/lua/luci/ucodebridge.lua'
no file '/usr/share/lua/luci/ucodebridge/init.lua'
no file '/usr/lib/lua/luci/ucodebridge.lua'
no file '/usr/lib/lua/luci/ucodebridge/init.lua'
no file './luci/ucodebridge.so'
no file '/usr/lib/lua/luci/ucodebridge.so'
no file '/usr/lib/lua/loadall.so'
no file './luci.so'
no file '/usr/lib/lua/luci.so'
no file '/usr/lib/lua/loadall.so'
In [anonymous function](), file [C]
In [anonymous function](), file /usr/share/ucode/luci/runtime.uc, line 133, byte 10:
called from function [arrow function] (/usr/share/ucode/luci/runtime.uc:141:63)
called from function render ([C])
called from function [anonymous function] (/usr/share/ucode/luci/runtime.uc:141:64)
called from function run_action (/usr/share/ucode/luci/dispatcher.uc:778:34)
called from function [anonymous function] (/usr/share/ucode/luci/dispatcher.uc:998:48)
called from anonymous function (/www/cgi-bin/luci:39:12)
die(ex);
Near here --------^
I googled and searched this forum and found many many many people with the same or similar errors but the closest I found to a solution was (unhelpfully) "just factory reset".
Once I got it working again I thought it would be nice to post how I resolved it so that the next person hopefully finds something a bit more useful than "just factory reset" when they have the same problem. Good luck, unknown future person!
I fixed it by SSH-ing into the router and running opkg install luci-app-uhttpd
Same exact error for me on ramips/mt7621 platform after using attended sysupgrade to 23.05-rc4. Also in order to fix this you don't need to install uhttpd, stuff that fixes this error is in luci-compat package so for the fix opkg install luci-compat is sufficient and you don't have that uhttpd tab in luci in the end.
Same thing happened to me. Except I suspect it's because I recently removed the luci-app-nut package, which may have recursively removed a bit too much.
Installing only luci-app-uhttpd didn't work for me as OP suggested. I did something similar like @adworacz did. I removed some package and I kept "Automatically remove unused dependencies" checked while doing it. That might have removed essential packages for luci.
I had to install:
opkg install luci-lua-runtime
Someone else might need to install luci-base too, as mentioned here.
Just if anyone stumbles on this ill add this info here, this happened to me too immediatly after un-installing the ddns package from luci, and i needed to run before the install:
heh i did this to myself a few weeks ago removing a luci theme i was trying, then again today removing a bunch of unbound packages. killed everything lol. so i swapped to my backup flash card and flashed my main lol...
Hi szero, please help..
I have same exact error like you, i'm using "Xiaomi Mi Router 4A Gigabit Edition".. can you help to describe step by step to manage the error?
sorry for my bad english
I also just ran into this issue after removing packages for unbound (including luci-app-unbound, which has luci-compat as a dependency) along with [x] Automatically remove unused dependencies. I found this thread after running a few remove/install combinations on my own and getting nowhere. [SOLVED] I fixed it as OP @iacvlvs did with opkg install luci-app-uhttpd and that fixed it for me.
I was unable to recreate the issue. I tried removing luci-app-uhttpd... no luci.ucodebridge error. Tried removing luci-compat... still no error. Tried reinstalling the unbound packages I had before and removing them as I did before (though I didn't run any of the setup on the unbound stuff)... still no error. So I'm still not sure what did it but I'd have to assume removing my unbound packages happened to remove some config file or package that the luci admin console thing required.
Linux OpenWrt 5.15.137 #0 SMP Tue Nov 14 13:38:11 2023 aarch64 GNU/Linux
LuCI openwrt-23.05 branch (git-24.034.54904-39d1aee) / OpenWrt 23.05.2 (r23630-842932a63d)
Thanks @szero . I discovered this issue today when attemting to login to my Edgerouter X to perform a sysupgrade to v23.05.3. Not sure what caused it since it was working find 71 days ago (uptime). I may have removed a package via cli at some point ... hard to remember!
Is there some way to re-architect the sysupgrade / package management system so this doesn't happen?
From a user-experience perspective it is egregiously bad to have a package-maintenance activity (such as uninstalling an unrelated package) completely BREAK basic administrative functionality on a device.
For example, in OPNsense & pfsense there are default "anti-lockout" firewall rules that are hard to disable, to prevent people from accidentally cutting off their own https & SSH administrative access to their own routers.
Something similar for the LuCi interface in OpenWRT would sure by nice to see. It should not be possible to incidentally & accidentally wipe out basic admin access to an OpenWRT device.