multipass icon indicating copy to clipboard operation
multipass copied to clipboard

Cannot connect to the multipass socket under Manjaro (was running)

Open daniel-alomar opened this issue 2 years ago • 6 comments

Describe the bug I installed multipass some weeks ago under Manjaro with no problems and I was running an Ubuntu Server. Yesterday I tried to access to the multipass instance and I was unable to access with the error "Cannot connect to the multipass socket"

I have already added my user to the sudo and adm group.

The socket file is not created

$ll /var/snap/multipass/common/                                                                                                                                                ✔ 
total 16K
drwxr-xr-x 3 root root 4,0K 20 d’abr.   22:53 apparmor.d
drwxr-xr-x 3 root root 4,0K 20 d’abr.   22:53 data
-rw-r--r-- 1 root root 3,6K 20 d’abr.   22:53 loaders.cache
-rw-r--r-- 1 root root   51 20 d’abr.   22:53 snap_config

I have tried already to start multipassd with no results

$sudo snap start multipass.multipassd                                                                                                                                          ✔ 
Started.

To Reproduce How, and what happened?

$multipass info --all
info failed: cannot connect to the multipass socket
Please ensure multipassd is running and '/var/snap/multipass/common/multipass_socket' is accessible

Expected behavior Get access to the VM

Logs

$journalctl --unit snap.multipass* 
zsh: no matches found: snap.multipass*

$snap info multipass                                                                                                                                                           ✔ 
name:      multipass
summary:   Instant Ubuntu VMs
publisher: Canonical✓
store-url: https://snapcraft.io/multipass
contact:   https://github.com/CanonicalLtd/multipass/issues/new
license:   GPL-3.0
description: |
  Multipass is a tool to launch and manage VMs on Windows, Mac and Linux that simulates a cloud
  environment with support for cloud-init. Get Ubuntu on-demand with clean integration to your IDE
  and version control on your native platform.
  
  Launch an instance (by default you get the current Ubuntu LTS)
  
     multipass launch --name foo
  
  Run commands in that instance, try running bash (logout or ctrl-d to quit)
  
     multipass exec foo -- lsb_release -a
  
  Pass a cloud-init metadata file to an instance on launch
  
     multipass launch -n bar --cloud-init cloud-config.yaml
  
  See your instances
  
     multipass list
  
  Stop and start instances
  
     multipass stop
     multipass start
  
  Get help
  
     multipass help
commands:
  - multipass.gui
  - multipass
services:
  multipass.multipassd: simple, enabled, active
snap-id:      mA11087v6dR3IEcQLgICQVjuvhUUBUKM
tracking:     latest/edge
refresh-date: yesterday at 22:53 CEST
channels:
  latest/stable:    1.8.0                    2021-10-27 (6130) 133MB -
  latest/candidate: 1.8.0                    2022-04-15 (6860) 134MB -
  latest/beta:      1.9.0-rc.446+ge1f4749a   2022-04-20 (6897) 134MB -
  latest/edge:      1.10.0-dev.775+gcd498a27 2022-04-19 (6889) 134MB -
installed:          1.10.0-dev.775+gcd498a27            (6889) 134MB -

Additional info Linux Xiuxiueig 5.17.1-3-MANJARO #1 SMP PREEMPT Thu Mar 31 12:27:24 UTC 2022 x86_64 GNU/Linux

  • multipass version: multipass 1.10.0-dev.775+gcd498a27
  • multipass info --all: info failed: cannot connect to the multipass socket

Additional context Add any other context about the problem here.

daniel-alomar avatar Apr 21 '22 04:04 daniel-alomar

$journalctl --unit snap.multipass* 
zsh: no matches found: snap.multipass*

Hi @daniel-alomar, this is ZSH trying to match a file named snap.multipass* - you need to escape the asterisk, e.g. journalctl --unit 'snap.multipass*'. We'll need these logs to see what's what.

FWIW Myself I prefer setopt NONOMATCH in my .zshrc

Saviq avatar Apr 21 '22 05:04 Saviq

Thanks! That do the trick to access the log file...

It seems I had problems since april 16th... d’abr. 16 09:05:36 Xiuxiueig systemd[1]: Started Service for snap application multipass.multipassd. d’abr. 16 09:05:36 Xiuxiueig multipassd[2586]: Using AppArmor support d’abr. 16 09:05:37 Xiuxiueig multipassd[2586]: Starting dnsmasq d’abr. 16 09:05:37 Xiuxiueig multipassd[2586]: Applied AppArmor policy: multipass.dnsmasq d’abr. 16 09:05:37 Xiuxiueig multipassd[2634]: QProcess: Destroyed while process ("dnsmasq") is still running. d’abr. 16 09:05:37 Xiuxiueig multipassd[2634]: [0] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interfa> d’abr. 16 09:06:07 Xiuxiueig multipassd[2586]: Failed to remove AppArmor policy #include <tunables/global> profile multipass.dnsmasq flags=(attach_disconnected) { #include <abstractions/base> #include <abstractions/nameservice>

                                               capability chown,
                                               capability net_bind_service,

...skipping... signal (receive) peer=snap.multipass.multipassd,

                                                # access to iface mtu needed for Router Advertisement messages in IPv6
                                                # Neighbor Discovery protocol (RFC 2461)
                                                @{PROC}/sys/net/ipv6/conf/*/mtu r,
                                              
                                                # binary and its libs
                                                /snap/multipass/6889/usr/sbin/dnsmasq ixr,
                                                /snap/multipass/6889/{usr/,}lib/@{multiarch}/{,**/}*.so* rm,
                                              
                                                # CLASSIC ONLY: need to specify required libs from core snap
                                                /{,var/lib/snapd/}snap/core18/*/{,usr/}lib/@{multiarch}/{,**/}*.so* rm,
                                              
                                                /var/snap/multipass/common/data/multipassd/network/dnsmasq.leases rw,           # Leases file
                                                /var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts r,             # Hosts file
                                              
                                                /var/snap/multipass/common/data/multipassd/network/dnsmasq-sLVYFU.conf r,     # conf file
                                              }
                                                  : errno=254 ()

d’abr. 21 08:25:59 Xiuxiueig multipassd[23951]: QProcess: Destroyed while process ("dnsmasq") is still running. d’abr. 21 08:25:59 Xiuxiueig multipassd[23951]: [23994] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-addre> d’abr. 21 08:25:59 Xiuxiueig multipassd[23951]: dnsmasq died: program: dnsmasq; error: Process crashed d’abr. 21 08:25:59 Xiuxiueig multipassd[23951]: Caught an unhandled exception: Multipass dnsmasq failed to start: program: dnsmasq; error: Process operation timed out d’abr. 21 08:25:59 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE d’abr. 21 08:25:59 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'. d’abr. 21 08:25:59 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 249. d’abr. 21 08:25:59 Xiuxiueig systemd[1]: Stopped Service for snap application multipass.multipassd. d’abr. 21 08:25:59 Xiuxiueig systemd[1]: Started Service for snap application multipass.multipassd. d’abr. 21 08:26:00 Xiuxiueig multipassd[24002]: Using AppArmor support d’abr. 21 08:26:00 Xiuxiueig multipassd[24002]: Starting dnsmasq d’abr. 21 08:26:00 Xiuxiueig multipassd[24002]: Applied AppArmor policy: multipass.dnsmasq d’abr. 21 08:26:00 Xiuxiueig multipassd[24050]: QProcess: Destroyed while process ("dnsmasq") is still running. d’abr. 21 08:26:00 Xiuxiueig multipassd[24050]: [0] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=1> d’abr. 21 08:26:30 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE d’abr. 21 08:26:30 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'. d’abr. 21 08:26:30 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 250. d’abr. 21 08:26:30 Xiuxiueig systemd[1]: Stopped Service for snap application multipass.multipassd. d’abr. 21 08:26:30 Xiuxiueig systemd[1]: Started Service for snap application multipass.multipassd. d’abr. 21 08:26:30 Xiuxiueig multipassd[24072]: Using AppArmor support d’abr. 21 08:26:30 Xiuxiueig multipassd[24072]: Starting dnsmasq d’abr. 21 08:26:30 Xiuxiueig multipassd[24072]: Applied AppArmor policy: multipass.dnsmasq d’abr. 21 08:26:31 Xiuxiueig multipassd[24115]: QProcess: Destroyed while process ("dnsmasq") is still running. d’abr. 21 08:26:31 Xiuxiueig multipassd[24115]: [0] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=1> d’abr. 21 08:27:01 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Main process exited, code=exited, status=1/FAILURE d’abr. 21 08:27:01 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Failed with result 'exit-code'. d’abr. 21 08:27:01 Xiuxiueig systemd[1]: snap.multipass.multipassd.service: Scheduled restart job, restart counter is at 251. d’abr. 21 08:27:01 Xiuxiueig systemd[1]: Stopped Service for snap application multipass.multipassd. d’abr. 21 08:27:01 Xiuxiueig systemd[1]: Started Service for snap application multipass.multipassd. d’abr. 21 08:27:01 Xiuxiueig multipassd[24123]: Using AppArmor support d’abr. 21 08:27:01 Xiuxiueig multipassd[24123]: Starting dnsmasq d’abr. 21 08:27:01 Xiuxiueig multipassd[24123]: Applied AppArmor policy: multipass.dnsmasq d’abr. 21 08:27:01 Xiuxiueig multipassd[24167]: QProcess: Destroyed while process ("dnsmasq") is still running. d’abr. 21 08:27:01 Xiuxiueig multipassd[24167]: [0] started: dnsmasq --keep-in-foreground --strict-order --bind-interfaces --pid-file --domain=multipass --local=/multipass/ --except-interface=lo --interface=mpqemubr0 --listen-address=1>

daniel-alomar avatar Apr 21 '22 06:04 daniel-alomar

Same issue here

endeavour avatar Apr 23 '22 11:04 endeavour

I think this relates to kernel upgrade. If I change my kernel back to 5.15.41-1 in manjaro settings, I can install and use multipass. Upgrading to 5.17 breaks it again.

~This might be related to a a change in AppArmor (which also broke microk8s, which I am trying to fix and test, which is why I want to install multipass...)~ it's not, it just started working again. Not sure what I did.

https://github.com/canonical/microk8s/issues/3161

MFAshby avatar May 29 '22 09:05 MFAshby

I have this issue as well. Just recently switched kernel version to 6.0 before I installed multipass so I don't know if it would work with a different kernel version.

The socket file at /var/snap/multipass/common/multipass_socket doesn't exist.

edit: I can confirm that switching back to 5.15 and reinstalling multipass makes this work

Imberflur avatar Sep 19 '22 01:09 Imberflur

Any tips on how to debug this issue would be welcome. I'm not sure where I need to look.

Imberflur avatar Sep 19 '22 01:09 Imberflur

Are there any updates on this issue? I get exactly the same outputs (cannot access socket, which isn't created and Cannot remove AppArmor policy). It used to work with kernel 5.15 and stopped working after I upgraded to 6.1 once it became clear that it will be the new LTS kernel. I'm on multipass 1.11

maxitar avatar Feb 23 '23 14:02 maxitar

Same issue here

Failed to remove AppArmor policy

....

                                             # access to iface mtu needed for Router Advertisement messages in IPv6
                                             # Neighbor Discovery protocol (RFC 2461)
                                             @{PROC}/sys/net/ipv6/conf/*/mtu r,
                                           
                                             # binary and its libs
                                             /snap/multipass/8465/usr/sbin/dnsmasq ixr,
                                             /snap/multipass/8465/{usr/,}lib/@{multiarch}/{,**/}*.so* rm,
                                           
                                             # CLASSIC ONLY: need to specify required libs from core snap
                                             /{,var/lib/snapd/}snap/core18/*/{,usr/}lib/@{multiarch}/{,**/}*.so* rm,
                                           
                                             /var/snap/multipass/common/data/multipassd/network/dnsmasq.leases rw,           # Leases file
                                             /var/snap/multipass/common/data/multipassd/network/dnsmasq.hosts r,             # Hosts file
                                           
                                             /var/snap/multipass/common/data/multipassd/network/dnsmasq-RyvNon.conf r,     # conf file
                                           }
                                               : errno=254 ()

notzippy avatar Feb 27 '23 01:02 notzippy

I had the same error and was just now able to resolve it by upgrading to the newest edge channel version of multipass

snap refresh multipass --channel edge

I'm now running multipass (edge) 1.12.0-dev.275+gfee233e2 on Kernel 6.1.12-1-MANJARO.

It seems to handle dnsmasq dying more gracefully? dnsmasq was still dying, because I dnsmasq.service running and it was blocking Port 53, but instead of just crashing, multipass actually alerted me to that fact. Now after disabling dnsmasq.service I was able to launch my multipass machine.

d4l-w4r avatar Mar 02 '23 21:03 d4l-w4r

snap refresh multipass --channel edge

Resolved my issue as well on Manjaro kernel 6.1.12

notzippy avatar Mar 08 '23 17:03 notzippy