Uhttpd: Bad Gateway

We are getting "Bad Gateway" on a WR1043ND uhttpd, OpenWRT Chaos Calmer.

This is a mission critical device that can't be restarted at the moment. We've already tried to reinstall LuCI using opkg update; opkg --force-maintainer --force-reinstall install uhttpd, with no results. The system still works perfectly as a router, and the SSH logread shows:

Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.880000] jffs2: warning: (9584) jffs2_get_inode_nodes: Eep. No valid nodes for ino #215.
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.890000] jffs2: warning: (9584) jffs2_do_read_inode_internal: no data nodes found for ino #215
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.900000] jffs2: iget() failed for ino #215
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.900000] jffs2: warning: (9584) jffs2_get_inode_nodes: Eep. No valid nodes for ino #215.
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.910000] jffs2: warning: (9584) jffs2_do_read_inode_internal: no data nodes found for ino #215
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.920000] jffs2: iget() failed for ino #215
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.930000] jffs2: warning: (9584) jffs2_get_inode_nodes: Eep. No valid nodes for ino #215.
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.940000] jffs2: warning: (9584) jffs2_do_read_inode_internal: no data nodes found for ino #215
Fri Apr  5 18:42:45 2019 kern.warn kernel: [786737.950000] jffs2: iget() failed for ino #215
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]: /usr/bin/lua: /www/cgi-bin/luci:2: module 'luci.cacheloader' not found:
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no field package.preload['luci.cacheloader']
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file './luci/cacheloader.lua'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/share/lua/luci/cacheloader.lua'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/share/lua/luci/cacheloader/init.lua'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/lib/lua/luci/cacheloader.lua'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/lib/lua/luci/cacheloader/init.lua'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file './luci/cacheloader.so'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/lib/lua/luci/cacheloader.so'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/lib/lua/loadall.so'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file './luci.so'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/lib/lua/luci.so'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      no file '/usr/lib/lua/loadall.so'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]: stack traceback:
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      [C]: in function 'require'
Fri Apr  5 18:42:45 2019 daemon.err uhttpd[29947]:      /www/cgi-bin/luci:2: in main chunk

We've tested write with WinSCP on some of the logged paths, and it was denied with an error, while another similar device allowed.

Any suggestions on how recover the uhttpd without restarting/flashing a newer firmware will be appreciated.

Those jffs2 warnings would have me more worried and ordering a replacement immediately.

It may be that the files that are needed are on a failed portion of the flash.

That would be the first thing I would check.

I'd also immediately take a backup, and consider a plan to go to "extroot" while waiting for a replacement.

3 Likes

An this is ancient version. When you have replaced the router, install the recent version of OpenWrt.

1 Like

Mounting a USB file system over the failing directory, potentially with symlinks if more than one directory tree is involved, might get you by until the new device arrives.

Thanks for the replies.

We have a settings backup file, but it was made from LuCI and from what I remember that doesn't keep package settings, like luci-app-ddns and mwan3.

4 questions:

  1. How make a full backup and migrate package settings?

  2. Settings from CC can usually be imported to 18.06.2 with no issues? We have VLAN settings and a lot of customizations that we cannot afford to lose.

  3. There is a stability test that we could do on this unit if it receives the newer 18.06.2?

  4. LuCI's 18.06.2 does a full backup, including packages?

Have a read through these
https://openwrt.org/docs/techref/sysupgrade
https://openwrt.org/docs/guide-user/installation/generic.sysupgrade

1 Like

Packages config can be saved, but you have to re-install packages after firmware upgrade, unless they are already included in the image you are flashing (let that be a release you downloaded or an image you built yourself to include the packages of your choice).

1 Like

Virtually all of the settings are in /etc/ Use of tar is perhaps the easiest, most reliable way to handle it. sysupgrade uses tar in conjunction with determining what needs to be saved according to the data related to packages installed and that in /etc/sysupgrade.conf

I say "virtually" as I know that just because I've never seen config elsewhere, it is a possibility with some package or software I'm not familiar with.


You probably should re-configure the packages based on looking at the settings. There have been very significant changes in both how configuration is done, as well as the packages themselves in the years since Chaos Calmer was released.

1 Like

Updated by SSH to the latest 18.06.2 keeping settings and had no serious issues.

dnsmasq needed the following on SSH to work:

echo "dnsmasq:*:453:dnsmasq" >> /etc/group
echo "dnsmasq:*:453:453:dnsmasq:/var:/bin/false" >> /etc/passwd
echo "dnsmasq:*:0:0:99999:7:::" >> /etc/shadow
chown dnsmasq.dnsmasq /usr/sbin/dnsmasq
2 Likes