"launcher rebuild" fails because of "ip addr show docker0"

סיכום מבוסס בינה מלאכותית

A user reported a failure when running launcher rebuild, which resulted in a cryptic error: Error: image library/10.0.42.1:latest not found. The root cause was identified as an issue with Docker’s network configuration on their Ubuntu 14.04 system. Specifically, the docker0 interface had two IP addresses (172.17.42.1 and 10.0.42.1), causing the launcher’s ip addr show | grep command to return multiple results. The script then incorrectly used the first address (which happened to be the user’s system IP) as the Docker image registry, leading to the failure user1.

Another user suggested that the problem stemmed from running an outdated Docker version (1.6) codinghorror. The original poster confirmed that updating Docker to version 1.11 resolved the immediate issue but noted that the underlying grep logic remains fragile and could benefit from better security checks user1. Consequently, the developer announced plans to raise the minimum required Docker version for the launcher from 1.6 to 1.8 to prevent similar errors for future users codinghorror.

I just tried to rebuild my container and hit the following error :

# ./launcher rebuild myforum
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker.io stop -t 10 myforum
myforum
cd /pups && git pull && /pups/bin/pups --stdin
Unable to find image '10.0.42.1:latest' locally
Pulling repository 10.0.42.1
FATA[0001] Error: image library/10.0.42.1:latest not found 
cat: cids/myforum_bootstrap.cid: No such file or directory
docker: "rm" requires a minimum of 1 argument. See '/usr/bin/docker.io rm --help'.
rm: cannot remove ‘cids/myforum_bootstrap.cid’: No such file or directory
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

I tracked this down to launcher#L78-L80

On my machine I get :

$ ip addr show docker0
3: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 56:84:7a:fe:97:99 brd ff:ff:ff:ff:ff:ff
    inet 172.17.42.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet 10.0.42.1/16 scope global docker0
       valid_lft forever preferred_lft forever

$ ip addr show docker0 |grep 'inet ' | awk '{ split($2,a,"/"); print a[1] }'
172.17.42.1
10.0.42.1

which makes the launcher#L499 line fail badly with the cryptic error message above :

Here are some info about my system :

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.4 LTS
Release:	14.04
Codename:	trusty

$ aptitude show docker.io  | grep ^Version
Version: 1.6.2~dfsg1-1ubuntu4~14.04.1

docker is used exclusively to run discourse.
I’m using discourse since more than a year, and have successfullly run launcher rebuild in the past. I just hit this issue today, trying to update my container.

Is this because your Docker version is so old at 1.6? I suggest updating Docker.

Updating docker to 1.11 was painful but fixes this.

but maybe the ip / grep / awk magic requires some extra security to avoid the strange message long after.

OK, good to know – I will make “minimum required docker verson” 1.8 for launcher (it was previously 1.6) right now, and see if that helps anyone in the future.