Luci is broken after opkg upgrade

Luci is broken after opkg upgrade.

I have installed OpenWRT 18.06.2 on TP-Link TL-WDR4900v1 several months ago and everything worked well until last week when i decide to update luci packages.

I updated Luci with the latest version (checked with "opkg list-upgradable") and after that luci does not work anymore, I got the following error:

# Bad Gateway
The process did not produce any response

I noticed that in the last few months you released many Luci updates, honestly I don't understand what are you doing, do you check new package releases before putting them in production?

Please help me to have Luci working againg without having to reinstall everything.

Thanks.

Maurizio

1 Like

Run /www/cgi-bin/luci as command via SSH and look for errors.

We have mentioned many times here not to upgrade packages, especially those that are part of the image like Luci.

3 Likes

Still LuCI package updates shouldn't break it the way the OP has described. There's been very little changes in the LuCI branch for OpenWrt 18.06, none of them severe enough to entirely break the ui.

1 Like

root@OpenWrt:~# /www/cgi-bin/luci
/usr/bin/lua: error loading module 'lucihttp' from file '/usr/lib/lua/lucihttp.so':
Error loading shared library /usr/lib/lua/lucihttp.so: Exec format error
stack traceback:
[C]: ?
[C]: in function 'require'
/usr/lib/lua/luci/util.lua:13: in main chunk
[C]: in function 'require'
/usr/lib/lua/luci/config.lua:4: in main chunk
[C]: in function 'require'
/usr/lib/lua/luci/cacheloader.lua:5: in main chunk
[C]: in function 'require'
/www/cgi-bin/luci:2: in main chunk
[C]: ?

lucihttp.so is 0 bytes after upgrade
same for other luci files, it seems that the upgrade recreated some empty files

copied the original lucihttp.so from /rom but it still does not work

I removed all luci packages one by one (opkg remove ....)
deleted /usr/lib/lua/ directory
deleted /etc/config/luci file
reinstalled luci with this option:
opkg install --force-maintainer luci

then I manually copied from /rom to /overlay the following files:
/usr/lib/lua/lucihttp.so
/usr/lib/lua/iwinfo.so
/usr/lib/lua/nixio.so
/usr/lib/lua/ubus.so
/usr/lib/liblua.so.5.1.5
/usr/lib/liblucihttp.so

now it works

Please pay more attention when you coders upgrade any package, also put a big warning sign "do not upgrade!" in the main openwrt page, not all can daily read the forum to discover that upgrade should not be done. I didn't know it,

Thanks.

1 Like

just to be sure I checked the usb dongle (new) I'm using as /overlay for defective sectors,
there are no r/w errors.
Also dmesg does not report any error.
So I suppose there is something wrong with the luci upgrade.

just to be clear, I did not upgrade Openwrt from 18.06.x to 18.06.2
I launched "opkg update",
verified the packages upgradable with
"opkg list-upgradable"
and then launched "opkg install luci-xxxxxx",
this is the way I updated the luci packages.

Understood.

No, nothing wrong. There are many threads on this. It should not be commonly used.

https://forum.openwrt.org/search?q=opkg%20upgrade

A previous version of a package should be removed; and the new version installed.

I checked https://downloads.openwrt.org/releases/18.06.2/packages/mips_24kc/luci/liblucihttp-lua_2019-06-05-91c01c3c-1_mips_24kc.ipk and it looks as expected. It also does not contain any zero-byte files.

Whatever happened in your case was not related to "us coders" not paying attention when upgrading packages.

3 Likes

Glad you were able to get running again. Check your free “disk” space to make sure you still have enough.

2 Likes

root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 61.2M 612.0K 60.6M 1% /tmp
/dev/sda1 14.2G 654.0M 12.8G 5% /overlay
overlayfs:/overlay 14.2G 654.0M 12.8G 5% /
tmpfs 512.0K 0 512.0K 0% /dev
overlayfs:/overlay 14.2G 654.0M 12.8G 5% /tmp/spool/asterisk

:+1:

12 GB should be plenty free -- Many people are working with 8 MB or less.

1 Like

Zero-byte files to me sounds more like a filesystem related issue (missing sync, bad journal recovery) or some other odd things occuring during the opkg unpack stage (OOM?).

There are definitely no valid, installable .ipk archives containing zero-byte files on the download servers. In case of a repo failure the package files would be either missing completely or be zero-length themselves which would render them invalid due to checksum mismatches.

7 Likes

Thanks a lot for your solution !
I have fixed my webpage for "http://192.168.1.1/cgi-bin/luci"
it's have the same problem with your situation
# Bad Gateway
The process did not produce any response

I also copy from the worked router directory to overlay the files
Please reference to my picture
sshot-2019-11-21-%5B11-39-34%5D