Bad Gateway after opkg update

So guys, I'm, as many user here, made a mistake and upgrade a few packages and faced with Bad gateway issue.
I tried to reinstall luci over ssh - without success.
I'm looked over the internet and didn't found any articles with same error that I have.

root@OpenWrt:~# /www/cgi-bin/luci
Runtime error: Unable to dlopen file '/usr/lib/ucode/': Error relocating /usr/lib/ucode/ lh_urldec_init: symbol not found
In module(), file /usr/share/ucode/luci/http.uc, line 1, byte 1:
  called from function module (/usr/share/ucode/luci/dispatcher.uc:13:27)
  called from anonymous function (/www/cgi-bin/luci:7:21)

 `// Copyright 2022 Jo-Philipp Wich <>`
  ^-- Near here

network still accessible, internet still working fine.

Maybe someone faced with the same issue and tell me how to solve it.
I have a huge config and reinstall the Openwrt is not the solution.
Please help

Upgrading packages (via the CLI opkg upgrade command or the LuCI Upgrade... button) can result in major problems. It is generally highly discouraged, unless you know what you are doing or if there is specific instruction to do so.

1 Like

It appears you are trying to run LuCI from the command line. This isn’t how it works, so the error makes sense.

What are you actually trying to achieve or what is wrong (other than the error you noted above)?

I tried to reinstall luci and get access over web, but have no idea how to fix the issue with installation

From my link above:

If you're already having issues, or wish to 'undo' the upgraded packages: create a backup (optional; can be restored after the reset is complete) and then perform a reset to defaults (firstboot ).

it's may be a problematic because i used a snapshot installation.

is there any chance to make ui live again?

my recommendation would be to reset to defaults using firstboot, then use the command line to install a stable release from there.

Do you need specific help to do that?
If so, what is the output of the following:

ubus call system board
root@OpenWrt:~# ubus call system board
	"kernel": "5.4.102",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 3",
	"model": "Raspberry Pi 4 Model B Rev 1.2",
	"board_name": "raspberrypi,4-model-b",
	"release": {
		"distribution": "OpenWrt",
		"version": "SNAPSHOT",
		"revision": "r16152-bff84f3e8e",
		"target": "bcm27xx/bcm2711",
		"description": "OpenWrt SNAPSHOT r16152-bff84f3e8e"

Oh... this is a Pi. So the best way would be to take the card out and use your computer to write the latest version of OpenWrt (22.03.2 is the latest as of this moment). By installing a stable release, you'll have LuCI preinstalled.

if so how can I fully backup my config over ssh