mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
13.98k stars 1.44k forks source link

Updating to latest errors with could not determine the IP or IPv6 address of the network interface #1890

Open arjitc opened 3 years ago

arjitc commented 3 years ago

I've been trying to update to the latest version but I get the following error,

Version: mailinabox.version returns "13" under /home/user-data

After running the command,

curl -s https://mailinabox.email/setup.sh | sudo bash

I've masked my IP with "AAA.BBB.C.DD". The server has network access and the IP returned back when checking with checkip.amazonaws.com is the same as "AAA.BBB.C.DD"

The following error is seen after the Hostname step,

I could not determine the IP or IPv6 address of the network inteface
for connecting to the Internet. Setup must stop.

AAA.BBB.C.DD
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         AA-BBB-CCC-D.re 0.0.0.0         UG    0      0        0 eth0
AA-BBB-CCC-D.re 0.0.0.0         255.255.255.255 UH    0      0        0 eth0
hija commented 3 years ago

What happens if you run:

ip route get 8.8.8.8
arjitc commented 3 years ago

What happens if you run:

ip route get 8.8.8.8

The output is blank/no output.

but, I was able to get around this issue by editing the file /root/mailinabox/setup/questions.sh

changing,

if [ -z "${PRIVATE_IP:-}" ]; then
        PRIVATE_IP=$(get_default_privateip 4)
fi

to

if [ -z "${PRIVATE_IP:-}" ]; then
        PRIVATE_IP="127.0.0.1"
fi

and then the update worked fine. The virtual machine/system has a slightly different network setup often seen with hosts like OVH.

hija commented 3 years ago

The output is blank/no output.

Alright. That's the reason why we get an error there, I guess.

It's cool that it works for you now. I hope that this problem won't occur to often - otherwise we need to think about a patch or another way to determine the address.

jvolkenant commented 3 years ago

@arjitc You'll need to find out what has taken over the "ip" command. Either by alias or another package (run \ip route get 8.8.8.8 to see if it is an alias). Or you may not have the iproute2 package. installed.

This is what my box looks like

root@m:~# alias ip
-bash: alias: ip: not found
root@m:~/mailinabox# which ip
/sbin/ip
root@m:~/mailinabox# dpkg -S /sbin/ip
iproute2: /sbin/ip
root@m:~/mailinabox# dpkg -l | grep iproute2
ii  iproute2                            4.15.0-2ubuntu1.2                           amd64        networking and traffic control tools
arjitc commented 3 years ago

@jvolkenant I have pretty much the same output here for the commands :)

root@mail:~# alias ip
-bash: alias: ip: not found
root@mail:~# which ip
/sbin/ip
root@mail:~# dpkg -S /sbin/ip
iproute2: /sbin/ip
root@mail:~# dpkg -l | grep iproute2
ii  iproute2                               4.15.0-2ubuntu1.2                               amd64        networking and traffic control tools
root@mail:~#