Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to "microk8s install" on macos #1287

Closed
indrasvat opened this issue Jun 9, 2020 · 16 comments
Closed

Unable to "microk8s install" on macos #1287

indrasvat opened this issue Jun 9, 2020 · 16 comments
Assignees

Comments

@indrasvat
Copy link

Following https://ubuntu.com/tutorials/install-microk8s-on-mac-os#3-install-microk8s for installation.

I currently cannot get past the microk8s install stage.

$ brew install ubuntu/microk8s/microk8s
...
installer: Package name is multipass
installer: Installing at base path /
installer: The install was successful.
🍺  multipass was successfully installed!
Waiting for multipass...
Launched: microk8s-vm                                                           
ping: snapcraft.io: Temporary failure in name resolution                        
An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 2.


$ microk8s uninstall
Thank you for using MicroK8s!


$ microk8s install
Launched: microk8s-vm                                                           
ping: snapcraft.io: Temporary failure in name resolution                        
An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 2.

Please run microk8s inspect and attach the generated tarball to this issue.

I can't run inspect, or any other sub-command either.

$ microk8s inspect
sudo: microk8s.inspect: command not found
An error occurred when trying to execute 'sudo microk8s.inspect' with 'multipass': returned exit code 1.

Hardware: MacBook Pro (Retina, 15-inch, Mid 2015)

OS: macOS Mojave v10.14.5

@ktsakalozos
Copy link
Member

Looks like a temporary (?) network issue. Is snapcraft.io reachable from your system? You may also want to look at common issues at [1].

[1] https://multipass.run/docs/troubleshooting-networking-on-macos

@indrasvat
Copy link
Author

@ktsakalozos, it's still happening (just tried again). I've tried with/without VPN and the issue persists.

I looked at the multipass troubleshooting guide you linked to, and don't see anything obvious pop out from there as an issue.

One thing I will note though--the guide mentions "Multipass uses “hyperkit” to run instances", and I'm wondering if this is the problem.

I today installed minikube, and when I created a VM using minikube start --driver=hyperkit, I had a similar, connectivity issue. In the k8s cluster I created there, none of the images could be downloaded, and upon running minikube ssh, I couldn't even, for e.g., curl www.google.com. Seems to be a known issue. None of the workarounds described in that issue worked for me. I had to switch to virtualbox as the driver, and then everything worked!

So, perhaps this is some hyperkit related issue that I'm running into, with both microk8s and minikube 🤷‍♂️?

@bmbferreira
Copy link

I'm also having issues running microk8s install but the error that I get is different:

> microk8s install
launch failed: The following errors occurred:
Instance stopped while starting
launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


launch failed: instance "microk8s-vm" already exists


An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

@joedborg
Copy link
Contributor

@kodeninja Thanks for letting us know. I'm wondering if minikube has set some weird network settings or, as you say, if Hyperkit is bugged. If you ever manage to fix it with hyperkit, please let us know and we'll document it or try to write an automated fix.

@joedborg
Copy link
Contributor

@bmbferreira Moved your issue to #1313

@HLFH
Copy link

HLFH commented Jun 27, 2020

Same issue does not work on macOS Catalina (10.15.5 Beta (19F94a)).

@charlesharden
Copy link

FYI - I have the same issue, but I can actually connect to network services, other than ping:
(base) @ / ==> multipass shell microk8s-vm
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-108-generic x86_64)

System information as of Mon Jun 29 12:40:05 PDT 2020

System load: 0.0 Processes: 99
Usage of /: 2.0% of 48.29GB Users logged in: 0
Memory usage: 3% IP address for enp0s2: 192.168.64.2
Swap usage: 0%

0 packages can be updated.
0 updates are security updates.

Last login: Mon Jun 29 12:33:46 2020 from 192.168.64.1
ubuntu@microk8s-vm:~$ nslookup www.google.com
Server: 127.0.0.53
Address: 127.0.0.53#53

Non-authoritative answer:
Name: www.google.com
Address: 172.217.14.196
Name: www.google.com
Address: 2607:f8b0:400a:800::2004

ubuntu@microk8s-vm:~$ ping www.google.com
PING www.google.com (172.217.14.196) 56(84) bytes of data.
^C
--- www.google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2168ms

So i think it's just an issue with ICMP...

However something doesn't appear to be working as none of the "microk8s" commands work:
(base) @ / ==> microk8s enable dashboard dns
sudo: microk8s.enable: command not found
An error occurred when trying to execute 'sudo microk8s.enable dashboard dns' with 'multipass': returned exit code 1.
(base) @ / ==> microk8s stop
sudo: microk8s.stop: command not found
An error occurred when trying to execute 'sudo microk8s.stop' with 'multipass': returned exit code 1.

So is something not complete do to this failure:
(base) @ / ==> microk8s install
Launched: microk8s-vm
An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

@zaloogarcia
Copy link

any solution?

@stryng
Copy link

stryng commented Oct 12, 2020

Same problem, rca was the existing vpn that did dns forwarding and locked me in the vpn dns. upon disabling it, microk8s install all downloading fine here.

@evantorrie
Copy link

Cisco VPN is usually the culprit in this situation

@dgeorgievski
Copy link

dgeorgievski commented Apr 13, 2021

@ktsakalozos, it's still happening (just tried again). I've tried with/without VPN and the issue persists.

I looked at the multipass troubleshooting guide you linked to, and don't see anything obvious pop out from there as an issue.

One thing I will note though--the guide mentions "Multipass uses “hyperkit” to run instances", and I'm wondering if this is the problem.

I today installed minikube, and when I created a VM using minikube start --driver=hyperkit, I had a similar, connectivity issue. In the k8s cluster I created there, none of the images could be downloaded, and upon running minikube ssh, I couldn't even, for e.g., curl www.google.com. Seems to be a known issue. None of the workarounds described in that issue worked for me. I had to switch to virtualbox as the driver, and then everything worked!

So, perhaps this is some hyperkit related issue that I'm running into, with both microk8s and minikube 🤷‍♂️?

Beside testing microk8s, I have replicated the same issue with kind k8s on Mac. It looks like from within the container or a multipass VM in this case it is not possible to ping. DNS resolution works however.

https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds

@pryorda
Copy link

pryorda commented Jul 7, 2021

I forcefully updated lib/python3.9/site-packages/vm_providers/_base_provider.py: self.run("ping -c 1 snapcraft.io".split(), hide_output=True) within the cellar to ping -c 127.0.0.1 to get by this error. I'm trying to figure out a good way to bypass this check if stealth mode is enabled.

❯ grep 127 /usr/local/Cellar/microk8s/2.1.0/libexec/lib/python3.9/site-packages/vm_providers/_base_provider.py
            self.run("ping -c 1 127.0.0.1".split(), hide_output=True)

@dardosordi
Copy link

This fixed it for me: #1368 (comment)

@cwagnello
Copy link

This fixed it for me: #1368 (comment)

@dardosordi this worked for me as well.

@tsluyter
Copy link

tsluyter commented Jan 8, 2022

This fixed it for me: #1368 (comment)

This no longer works flawlessly. An additional fix is needed, because the ping doesn't always work on MacOS. I will add an update in issue 1368.

@bcaleffi
Copy link

Cisco VPN is usually the culprit in this situation

Worked for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests