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

An error occurred when trying to execute 'sudo snap install microk8s --classic' with 'multipass': returned exit code 1. #239

Closed
SimonAmbridgeNuoDB opened this issue Mar 30, 2020 · 17 comments
Assignees

Comments

@SimonAmbridgeNuoDB
Copy link

Summary

$ microk8s install
Launched: MicroK8sVM
error: unable to contact snap store
An error occurred when trying to execute 'sudo snap install microk8s --classic' with 'multipass': returned exit code 1.

Process

Mac installation as described in the setup guide

  1. brew install ubuntu/microk8s/microk8s
  2. microk8s install

Current and expected result

Cannot use microk8s commands e.g.

$ microk8s --help
Usage: microk8s [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.

Commands:
install Installs MicroK8s. Use --cpu, --mem, --disk to appoint resources.
uninstall Removes MicroK8s
ls: cannot access '/snap/bin/': No such file or directory
An error occurred when trying to execute 'sudo ls -1 /snap/bin/' with 'multipass': returned exit code 2.

  • Running as sudo does not correct the problem

Screenshot

[If relevant, include a screenshot.]

Browser details

Mac, Cataline 10.15.3, Chrome
[Optionally - if you can, copy the report generated by mybrowser.fyi - this might help us debug certain types of issues.]

@pmahnke
Copy link
Contributor

pmahnke commented Mar 31, 2020

@evilnick can you look at this?

@pmahnke pmahnke assigned evilnick and unassigned pmahnke Mar 31, 2020
@joedborg
Copy link
Contributor

Hi @SimonAmbridgeNuoDB,

My guess would be that you had internet connectivity issues at the time of install. Please can you try the following:

First, delete the broken VM.

multipass delete -p MicroK8sVM

Then try to reinstall MicroK8s:

microk8s install

And let me know if you still see the issue.

Thanks,
Joe

@SimonAmbridgeNuoDB
Copy link
Author

Hi Joe

You're right about a connection error, it's timing-out on snapcraft.io but all other access is fine:

$ multipass delete -p MicroK8sVM

$ microk8s install
Launched: MicroK8sVM
error: cannot perform the following tasks:

$ ping https://snapcraft.io
ping: cannot resolve https://snapcraft.io: Unknown host

$ ping 91.189.92.38
PING 91.189.92.38 (91.189.92.38): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

$ ping www.google.com
PING www.google.com (172.217.10.36): 56 data bytes
64 bytes from 172.217.10.36: icmp_seq=0 ttl=51 time=84.190 ms
64 bytes from 172.217.10.36: icmp_seq=1 ttl=51 time=84.206 ms
64 bytes from 172.217.10.36: icmp_seq=2 ttl=51 time=83.974 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 83.974/84.123/84.206/0.106 ms

@johnsca
Copy link

johnsca commented Mar 31, 2020

@SimonAmbridgeNuoDB You can't ping with a URL schema (https://). Can you please try:

ping snapcraft.io

You might also try the following and see if that works and is sending you to a specific CDN (the Location URL in the response header):

curl -I https://api.snapcraft.io/api/v1/snaps/download/99T7MUlRhtI3U0QFgl5mXXESAiSwt776_8689.snap

Edit: For reference, I get sent to canonical-lcy01.cdn.snapcraft.io which is working for me.

@SimonAmbridgeNuoDB
Copy link
Author

Hi John

I can resolve snapcraft.io:

$ ping snapcraft.io
PING snapcraft.io (91.189.91.45): 56 data bytes
64 bytes from 91.189.91.45: icmp_seq=0 ttl=50 time=80.750 ms

Info from curl:
$ curl -I https://api.snapcraft.io/api/v1/snaps/download/99T7MUlRhtI3U0QFgl5mXXESAiSwt776_8689.snap
HTTP/1.1 302 FOUND
Server: gunicorn/19.7.1
Date: Tue, 31 Mar 2020 16:15:08 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 553
Location: https://canonical-bos01.cdn.snapcraft.io/download-origin/canonical-lgw01/99T7MUlRhtI3U0QFgl5mXXESAiSwt776_8689.snap?token=1585684800_efdd9e6624b51d468e13397d071aa286b2415efa
Snap-Store-Version: 21
X-View-Name: snapdevicegw.webapi_download.snap_download
X-VCS-Revision: e867a14
X-Request-Id: A578CBDFEB150A325C8501BB5E836C88FD3E13

I can reach canonical-bos01.cdn.snapcraft.io too:
$ ping canonical-bos01.cdn.snapcraft.io
PING canonical-bos01.cdn.snapcraft.io (91.189.91.42): 56 data bytes
64 bytes from 91.189.91.42: icmp_seq=0 ttl=49 time=82.493 ms

But I still get this:

$ multipass delete -p MicroK8sVM
$ microk8s install
Launched: MicroK8sVM
error: unable to contact snap store
An error occurred when trying to execute 'sudo snap install microk8s --classic' with 'multipass': returned exit code 1.

Thanks
Simon

@SimonAmbridgeNuoDB
Copy link
Author

Behaviour is slightly different if I run microk8s uninstall (instead of multipass delete -p MicroK8sVM) before microk8s install:

$ microk8s uninstall
Thank you for using MicroK8s!

$ microk8s install
Launched: MicroK8sVM
error: cannot perform the following tasks:

I can reach that IP too:

$ ping 91.189.92.41
PING 91.189.92.41 (91.189.92.41): 56 data bytes
64 bytes from 91.189.92.41: icmp_seq=0 ttl=52 time=12.809 ms
64 bytes from 91.189.92.41: icmp_seq=1 ttl=52 time=11.304 ms

@joedborg
Copy link
Contributor

Hi @SimonAmbridgeNuoDB, could you please show me the output of multipass version?

Also (before uninstalling MicroK8s or removing MicroK8sVM), could you please try

multipass exec MicroK8sVM -- ping snapcraft.io

Many thanks,
Joe

@SimonAmbridgeNuoDB
Copy link
Author

Hi Joe

I get this output:

$ multipass version
multipass 1.1.0+mac
multipassd 1.1.0+mac

$ multipass exec MicroK8sVM -- ping snapcraft.io
PING snapcraft.io (91.189.88.181) 56(84) bytes of data.
^C
--- snapcraft.io ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10678ms

Thanks
Simon

@joedborg
Copy link
Contributor

joedborg commented Apr 1, 2020

Hey @SimonAmbridgeNuoDB,

Thanks for the info and your patience.

I think this is a networking issue with multipass on your machine. Could you just confirm this with a fresh VM please?

multipass launch -n test
multipass exec test -- ping snapcraft.io -c 3
multipass exec test -- ping 1.1.1.1 -c 3  # Prove it's not a DNS resolution issue
multipass delete -p test

If you're still seeing this issue, could you please raise this here: https://github.com/canonical/multipass/issues/new?assignees=&labels=bug&template=bug_report.md&title= and tag me in it so I can keep a track?

Many thanks,
Joe

@SimonAmbridgeNuoDB
Copy link
Author

Hi Joe

No problem, happy to help, I'd like toget it too :)

$ multipass launch -n test
Launched: test

Multipass ping fails:
$ multipass exec test -- ping snapcraft.io -c 3
PING snapcraft.io (91.189.91.44) 56(84) bytes of data.
--- snapcraft.io ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2165ms

But I can ping from the command line:
$ ping snapcraft.io
PING snapcraft.io (91.189.88.180): 56 data bytes
64 bytes from 91.189.88.180: icmp_seq=0 ttl=54 time=10.872 ms
64 bytes from 91.189.88.180: icmp_seq=1 ttl=54 time=10.967 ms

Ping Cloudflare DNS fails:
$ multipass exec test -- ping 1.1.1.1 -c 3
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2100ms

But I don't think you can get a ping response from 1.1.1.1 anyway:
$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

However I can ping Google DNS, but that fails with multipass:
$ multipass exec test -- ping 8.8.8.8 -c 3
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2165ms

Would you like me to go ahead with the bug report?

Simon

@joedborg
Copy link
Contributor

joedborg commented Apr 1, 2020

Ah thanks @SimonAmbridgeNuoDB, I thought the CloudFlare ones worked too. Yes please, when I say I think there's a networking issue, I mean I don't think multipass is bridging to your host correctly. Sadly, I'm not expert enough in multipass to be able to help with that, but I'd like to be able to see the bug in case more people see this :)

@SimonAmbridgeNuoDB
Copy link
Author

Will do and thanks for the help.

@joedborg
Copy link
Contributor

joedborg commented Apr 1, 2020

No worries, thanks for raising it @SimonAmbridgeNuoDB

@evilnick can you close this, please? Moved to canonical/multipass#1459

@evilnick evilnick closed this as completed Apr 3, 2020
@quantuminformation
Copy link

quantuminformation commented Jul 28, 2022

I got this, not sure if its a new issue

An error occurred when trying to execute 'sudo ping -c 1 snapcraft.io' with 'multipass': returned exit code 1.

image

image

@kf-rammanokar
Copy link

This issue has been resolved after disabling stealth mode in firewall setting,
@quantuminformation fyi

https://multipass.run/docs/troubleshooting-networking-on-macos#heading--dns-problems
image

@quantuminformation
Copy link

oh thx! will test now

@cenobitedk
Copy link

I encountered this error, and with the guide @kf-rammanokar linked above (https://multipass.run/docs/troubleshoot-networking#heading--dns-problems) I found the problem to be Cisco Anyconnect.

$ sudo lsof -iTCP:53 -iUDP:53 -n -P
COMMAND     PID           USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
mDNSRespo   262 _mdnsresponder   75u  IPv4 0xc344cf90a872e81      0t0  UDP *:53
mDNSRespo   262 _mdnsresponder   84u  IPv6 0xc344cf90a8734e1      0t0  UDP *:53
mDNSRespo   262 _mdnsresponder   89u  IPv4 0xc344cf8fde200c9      0t0  TCP *:53 (LISTEN)
mDNSRespo   262 _mdnsresponder   90u  IPv6 0xc344d02931eec01      0t0  TCP *:53 (LISTEN)
com.cisco 34641           root   10u  IPv4 0xc344cf90a772b51      0t0  UDP 1*.1**.9*.1**:52920->1*.1**.*.3*:53
com.cisco 34641           root   12u  IPv4 0xc344cf907510811      0t0  UDP 1*.1**.9*.1**:59664->1*.1**.*.3*:53
com.cisco 34641           root   13u  IPv4 0xc344cf90a51ee81      0t0  UDP 1*.1**.9*.1**:56556->1*.1**.*.3*:53
com.cisco 34641           root   14u  IPv4 0xc344cf90a5344e1      0t0  UDP 1*.1**.9*.1**:60227->1*.1**.*.3*:53
com.cisco 34641           root   15u  IPv4 0xc344cf90a5a0811      0t0  UDP 1*.1**.9*.1**:52804->1*.1**.*.3*:53
com.cisco 34641           root   16u  IPv4 0xc344cf90a8284e1      0t0  UDP 1*.1**.9*.1**:52834->1*.1**.*.3*:53
com.cisco 34641           root   17u  IPv4 0xc344cf90a5244e1      0t0  UDP 1*.1**.9*.1**:51943->1*.1**.*.3*:53
com.cisco 34641           root   18u  IPv4 0xc344cf90a5241b1      0t0  UDP 1*.1**.9*.1**:61779->1*.1**.*.3*:53

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

8 participants