Forum archive
Confconsole crashing after removing a virtual NIC
Hello! I'm using the Turnkey LAMP Stack image to operate a reverse proxy in my network infrastructure as a virtual machine on Microsoft's Hyper-V platform. I originally set up this reverse proxy with 2 network adapters/interface cards (NICs): one to speak to the outer web (WAN; on eth0) and one to speak to servers on the local network (LAN; on eth1). I've since changed the network settings beyond the scope of this virtual machine so it doesn't require the WAN NIC anymore, just the LAN, so I removed the WAN NIC in the virtual machine's Hyper-V settings. This broke its network connectivity, but I fixed it by manually editing /etc/network/interfaces to account for the machine having 1 less NIC. This restored network connectivity for the reverse proxy server, so it's still able to connect to the internet and receive updates, and is still completely functional as a reverse proxy, but when I try to access confconsole (both on system startup and when using the confconsole command), the window is filled with a Python exception message, stating that the second NIC (eth1) isn't found:
Traceback (most recent call last):
File "/usr/bin/confconsole", line 718, in loop
new_dialog = method()
File "/usr/bin/confconsole", line 398, in usage
ifname = self._get_default_nic()
File "/usr/bin/confconsole", line 273, in _get_default_nic
if defifname and _validip(defifname):
File "/usr/bin/confconsole", line 267, in _validip
ip = ifutil.get_ipconf(ifname)[0]
File "/usr/lib/confconsole/ifutil.py", line 307, in get_ipconf
net = InterfaceInfo(ifname)
File "/usr/lib/python3/dist-packages/netinfo/__init__.py", line 104, in __init__
raise NetInfoError(f"no such interface '{ifname}'")
netinfo.NetInfoError: no such interface 'eth1'Pressing Enter while this message is up doesn't seem to do anything and I have to CTRL+C to return to the shell. Before removing the WAN NIC, I think I set the primary/default NIC to eth1 (the LAN NIC, "the second NIC"), and then I removed the WAN NIC, which would explain why confconsole is complaining that eth1 no longer exists. Is there anywhere else I can configure confconsole so the default NIC is eth0 instead of eth1? Or would it be better to create some sort of temporary null/dummy NIC on eth1 so confconsole doesn't crash on startup and I can change the default?
While my changes to /etc/network/interfaces restored its network connection, the confconsole exception continued to appear. Current contents of /etc/network/interfaces (with redacted specifics):
# UNCONFIGURED INTERFACES # remove the above line if you edit this file auto lo iface lo inet loopback # Current LAN interface auto eth0 iface eth0 inet static hostname webapp-arp address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers x.x.x.x x.x.x.x # Old WAN interface #auto eth0 #iface eth0 inet static # hostname webapp-arp # address x.x.x.x # netmask x.x.x.x # gateway x.x.x.x # dns-nameservers x.x.x.x x.x.x.x # Old LAN interface #allow-hotplug eth1 #iface eth1 inet static # hostname webapp-arp # address 192.168.1.10 # netmask 255.255.255.0 # gateway 192.168.1.1 # dns-nameservers x.x.x.x x.x.x.x
Output of turnkey-version:
turnkey-lamp-18.0-bookworm-amd64
Output of apt cache confconsole (I tried running this command on a separate Turnkey image that is 100% functional and received this same error message):
E: Invalid operation cache
Thank you very much for your time!
Hi Jeremy, thanks so much for your response! I made the configuration edit and confconsole loads as expected now, so the issue is officially resolved.
To be thorough, here's the output of the corrected apt command:
Perhaps the new error message can be something along the lines of "Default NIC is {nonexistent_nic_name}, which is unavailable." Then it would be especially helpful to see a list of the available NICs with a prompt to change the default NIC to one of them. The list of available NICs could come from parsed output of the bash command "ip a" and should be limited to NICs that have "UP" status (I'm pretty sure the "ip" command is a built-in bash or Linux utility and should be readily available).
Cheers mate!