Brandon Delehoy's picture

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/", line 307, in get_ipconf
    net = InterfaceInfo(ifname)

File "/usr/lib/python3/dist-packages/netinfo/", 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):

# 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
    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
#    netmask
#    gateway
#    dns-nameservers x.x.x.x x.x.x.x

Output of turnkey-version:


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!

Jeremy Davis's picture

Hi Brandon. Thanks very for reporting your issue. And thanks too for providing all the info I asked for your in "intro post".

Starting at the end, that failing 'apt' command was my bad. I meant to ask for 'apt list confconsole'. It was a "brain fart" as they say here in Australia! :) (Perhaps where you are too?)

For some context (in my common rambling style), please read on. If you're in a rush and/or you're not into ramble, please skip to below the next horizontal rule. :)

FWIW I mixed up a few different commands, and asked you for something that was never going to work. Apologies about that. Historically the package related apt commands were either 'apt-get SUB_COMMAND' or 'apt-cache SUB_COMMAND'. Modern apt still supports those commands and they are recommend for use in scripts (i.e. non interactive). However, the preferred interactive commands now are all 'apt SUB_COMMAND' these days.

When responding to your post, I initially asked for the succinct package version info provided by the "modern" 'apt list confconsole' command. Then I changed my mind, intending to ask you for the more detailed info displayed by the 'apt policy confconsole' command. But when editing my post, on auto pilot I mixed up the modern command with the "legacy" one, 'apt-cache policy confconsole'.

TLDR; I completely muffed my edit...!

Re the confconsole issue, that's clearly a bug; an oversight on our behalf. A situation we hadn't accounted for.

I've just double checked and unsurprisingly, I can reproduce it and have a few ideas on what behavior is preferable. At the very least it should fail gracefully; with a meaningful error message, rather than a stacktrace. Even better, it probably should either offer to fix it, or just fix it for you, probably with a message about what it's done. As such, I've opened an bug report.

I'd be interested in your thoughts on the best fix. And perhaps even the message you think it should show.

I'll aim to fix that ASAP. But in the meantime you can resolve the current error by editing the config file (/etc/confconsole/confconsole.conf) and change the default NIC to 'eth0'. I.e. so it looks like this:

default_nic eth0

Then restart Confconsole - with the command 'confconsole'. After that it should work as expected.

Thanks again for reporting and please don't hesitate to let me know if you have any further issues, ideas for improvements or any other feedback.

Brandon Delehoy's picture

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:

# apt list confconsole
Listing... Done
confconsole/bookworm 2.1.5 all [upgradable from: 2.1.4]
N: There is 1 additional version. Please use the '-a' switch to see it

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!

Add new comment