snap version 826 has a bug with network interface that has 2 ip addresses
See original GitHub issueLast night, due to one a design defect in the snap system (forced upgrades with no way to stop it), my system upgraded to the the 826 version of the microk8s snaps. Since this version has a new bug it stopped my microk8s cluster from coming back up with the new version.
I think the line of code with a bug is this one:
https://github.com/ubuntu/microk8s/blob/master/microk8s-resources/actions/common/utils.sh#L158
It does not account for interfaces with two ip addresses.
output of ip -o -4 addr list "eth0"
on gir
(my home server)
2: eth0 inet 192.168.42.8/24 brd 192.168.42.255 scope global eth0\ valid_lft forever preferred_lft forever
2: eth0 inet 192.168.69.1/24 brd 192.168.69.255 scope global eth0:2\ valid_lft forever preferred_lft forever
because of this it tries to set the advertise-client-urls
for etcd to https://192.168.42.8 192.168.69.1:12379
which etcd doesn’t like.
logs
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + source /snap/microk8s/826/actions/common/utils.sh
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + '[' -S /var/snap/microk8s/current/etcd.socket:2379 ']'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ arch
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ echo amd64
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + ARCH=amd64
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + '[' amd64 = amd64 ']'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ get_default_ip
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ /snap/microk8s/826/usr/bin/gawk '{print $NF}'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ head -1
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ /snap/microk8s/826/bin/grep '^0.0.0.0'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ /snap/microk8s/826/bin/netstat -rn
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ local DEFAULT_INTERFACE=eth0
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ /snap/microk8s/826/sbin/ip -o -4 addr list eth0
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ /snap/microk8s/826/usr/bin/gawk '{print $4}'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: +++ /snap/microk8s/826/usr/bin/cut -d/ -f1
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ local 'IP_ADDR=192.168.42.8
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: 192.168.69.1'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ [[ -z 192.168.42.8
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: 192.168.69.1 ]]
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ echo '192.168.42.8
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: 192.168.69.1'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + export 'DEFAULT_INTERFACE_IP_ADDR=192.168.42.8
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: 192.168.69.1'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + DEFAULT_INTERFACE_IP_ADDR='192.168.42.8
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: 192.168.69.1'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: ++ cat /var/snap/microk8s/826/args/etcd
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + declare -a 'args=(--data-dir=${SNAP_COMMON}/var/run/etcd
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: --advertise-client-urls=https://${DEFAULT_INTERFACE_IP_ADDR}:12
379
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: --listen-client-urls=https://0.0.0.0:12379
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: --client-cert-auth=true
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: --trusted-ca-file=${SNAP_DATA}/certs/ca.crt
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: --cert-file=${SNAP_DATA}/certs/server.crt
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: --key-file=${SNAP_DATA}/certs/server.key)'
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: + exec /snap/microk8s/826/etcd --data-dir=/var/snap/microk8s/common/var/run/etcd --advertise-client-urls=https://192.168.42.8 192.168.69.1:12379 --listen-client-urls=https://0.0.0.0:12379 --client-cert-auth=true --trusted-ca-file=/var/snap/microk8s/826/certs/ca.crt --cert-file=/var/snap/microk8s/826/certs/server.crt --key-file=/var/snap/microk8s/826/certs/server.key
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: invalid value "https://192.168.42.8" for flag -advertise-client-urls: URL address does not have the form "host:port": https://192.168.42.8
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: usage: etcd [flags]
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: start an etcd server
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: etcd --version
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: show the version of etcd
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: etcd -h | --help
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: show the help information about etcd
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: etcd --config-file
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: path to the server configuration file
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: etcd gateway
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: run the stateless pass-through etcd TCP connection forwarding proxy
Sep 06 07:51:29 gir microk8s.daemon-etcd[27177]: etcd grpc-proxy
Thankfully snaps have a way to revert, so I was able to get back in action with sudo snap revert microk8s
.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@ktsakalozos Thank you! Edge version 834 solved that problem for me, cluster successfully started
I’m now running 920 and this works. Thanks for your prompt help @ktsakalozos !