Luci Bad Gateway after installing packages

I installed the packages listed under "Offline installation" from this article: https://openwrt.org/docs/guide-user/luci/luci.essentials

But whenever I access 192.168.1.1, I always receive:

Bad Gateway 
The process did not produce any response

Tried running /www/cgi-bin/luci and this is the output:

root@OpenWrt:~# /www/cgi-bin/luci
/usr/bin/lua: /usr/lib/lua/luci/config.lua:4: module 'luci.util' not found:
        no field package.preload['luci.util']
        no file './luci/util.lua'
        no file '/usr/share/lua/luci/util.lua'
        no file '/usr/share/lua/luci/util/init.lua'
        no file '/usr/lib/lua/luci/util.lua'
        no file '/usr/lib/lua/luci/util/init.lua'
        no file './luci/util.so'
        no file '/usr/lib/lua/luci/util.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'
stack traceback:
        [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]: ?
root@OpenWrt:~#

What am I missing or doing wrong?

I've just had this same issue. The list of luci packages that is now working for me is below. It was luci-lib-base that got me past 'luci.util' not found.

liblua libubus libubus-lua libuci-lua lua luci-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-theme-bootstrap rpcd uhttpd luci luci-app-firewall luci-app-opkg luci-mod-network luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp rpcd-mod-luci rpcd-mod-rrdns luci-lib-base

1 Like

Hi, thank you for giving me your list of packages. the luci.util not found error is now gone, but it was replaced with this:

root@OpenWrt:~# /www/cgi-bin/luci
/usr/bin/lua: /usr/lib/lua/luci/util.lua:13: module 'lucihttp' not found:
        no field package.preload['lucihttp']
        no file './lucihttp.lua'
        no file '/usr/share/lua/lucihttp.lua'
        no file '/usr/share/lua/lucihttp/init.lua'
        no file '/usr/lib/lua/lucihttp.lua'
        no file '/usr/lib/lua/lucihttp/init.lua'
        no file './lucihttp.so'
        no file '/usr/lib/lua/lucihttp.so'
        no file '/usr/lib/lua/loadall.so'
stack traceback:
        [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]: ?
root@OpenWrt:~#

do you also have an idea to fix this or have you encountered this before too?

Sorry, I missed a couple. Try installing the libluci* packages too

root@OpenWrt:~# opkg list-installed | grep luci
liblucihttp-lua - 2019-07-05-a34a17d5-1
liblucihttp0 - 2019-07-05-a34a17d5-1
luci - git-20.303.33604-f193364
luci-app-firewall - git-20.303.33604-f193364
luci-app-openvpn - git-20.303.33604-f193364
luci-app-opkg - git-20.303.33604-f193364
luci-app-statistics - git-20.303.33604-f193364
luci-base - git-20.303.33604-f193364
luci-lib-base - git-20.303.33604-f193364
luci-lib-ip - git-20.303.33604-f193364
luci-lib-jsonc - git-20.303.33604-f193364
luci-lib-nixio - git-20.303.33604-f193364
luci-mod-admin-full - git-20.303.33604-f193364
luci-mod-network - git-20.303.33604-f193364
luci-mod-status - git-20.303.33604-f193364
luci-mod-system - git-20.303.33604-f193364
luci-proto-ipv6 - git-20.303.33604-f193364
luci-proto-ppp - git-20.303.33604-f193364
luci-theme-bootstrap - git-20.303.33604-f193364
rpcd-mod-luci - 20191114
2 Likes

Thank you for providing your page list, I can access the luci page now.

But another problem arise, and it's this:

I can't see anything on my dashboard, and some menus produces error. Do you have an idea what's happening here too?

I'm having the same problem. Force reloading the page has helped a bit. I have to leave it for now, please let us know if you find which package(s) fix it.

1 Like

Thank you for your help, I really appreciate it!

In case you haven't seen it, there are others also reporting issues installing luci. The underlying issue seems to be opkg not installing dependencies.
See this thread for more info: Opkg doesn't install dependencies, or get configured

1 Like

Thank you for the informing me. Hoping for the dev team to notice it a push a fix soon.

Also saw a comment on this bug report that the previous commit, which is around 31/10 is working: https://bugs.openwrt.org/index.php?do=details&task_id=3420&order=dateopened&sort=desc
Have you tried experimenting building your own snapshot bin and using it?

It seems the last "OK" version is 2020-08-31-cf44c2fe-1.

Does anyone know how to mitigate this, step-by-step, through this kind of workaround?

See the solution for this issue:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.