question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

snap version 826 has a bug with network interface that has 2 ip addresses

See original GitHub issue

Last 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:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
alexey-chernikovcommented, Sep 10, 2019

@ktsakalozos Thank you! Edge version 834 solved that problem for me, cluster successfully started

0reactions
myerscommented, Sep 26, 2019

I’m now running 920 and this works. Thanks for your prompt help @ktsakalozos !

Read more comments on GitHub >

github_iconTop Results From Across the Web

When RHEL has multiple IPs configured, only one is ...
When RHEL has multiple IPs configured, only one is reachable from a remote network. Or why does RHEL ignore packets when the route...
Read more >
Ubuntu Manpage: arp-scan - The ARP scanner
ARP was designed to work with any layer-2 and layer-3 address format, but the most common use is to map IP addresses to...
Read more >
TCP BTL: problems when there are multiple IP interfaces in ...
If Open MPI sees multiple network interfaces, it will spread traffic across all of them. Open MPI balances traffic at the device, not...
Read more >
ARP Configuration Guide, Cisco IOS XE Fuji 16.9.x
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ... IP addressing occurs at Layer 2 (data link) and Layer 3 (network) of...
Read more >
RFC 1122 - Requirements for Internet Hosts - IETF Datatracker
This RFC covers the communications protocol layers: link layer, IP layer, ... if it has more than one interface to the same or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found