About a month ago, I was able to build, install, and run two instances of my snap. Now, I’m facing trouble.
Cannot connect interfaces
I started out with two instances: my-snap_1
and my-snap_2
.
The trouble starts when I try to connect interfaces on the second instance.
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:account-control
error: cannot perform the following tasks:
- Connect my-snap_2:account-control to core:account-control (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:home
error: cannot perform the following tasks:
- Connect my-snap_2:home to core:home (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:log-observe
error: cannot perform the following tasks:
- Connect my-snap_2:log-observe to core:log-observe (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:mount-observe
error: cannot perform the following tasks:
- Connect my-snap_2:mount-observe to core:mount-observe (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:network-bind
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:network-control
error: cannot perform the following tasks:
- Connect my-snap_2:network-control to core:network-control (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:process-control
error: cannot perform the following tasks:
- Connect my-snap_2:process-control to core:process-control (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:system-backup
error: cannot perform the following tasks:
- Connect my-snap_2:system-backup to core:system-backup (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder# snap connect my-snap_2:system-observe
error: cannot perform the following tasks:
- Connect my-snap_2:system-observe to core:system-observe (cannot update mount namespace of snap "my-snap_2": cannot update preserved namespace of snap "my-snap_2": cannot update snap namespace: remove /snap/my-snap/x1/usr/bin/nodejs12.x: no such file or directory)
root@ip-172-31-59-113:/home/ubuntu/SnapBuilder#
ubuntu@ip-172-31-59-113:~$ snap connections my-snap_1
Interface Plug Slot Notes
account-control my-snap_1:account-control :account-control manual
home my-snap_1:home :home manual
log-observe my-snap_1:log-observe :log-observe manual
mount-observe my-snap_1:mount-observe :mount-observe manual
network-bind my-snap_1:network-bind :network-bind -
network-control my-snap_1:network-control :network-control manual
process-control my-snap_1:process-control :process-control manual
system-backup my-snap_1:system-backup :system-backup manual
system-observe my-snap_1:system-observe :system-observe manual
ubuntu@ip-172-31-59-113:~$ snap connections my-snap_2
Interface Plug Slot Notes
account-control my-snap_2:account-control - -
home my-snap_2:home - -
log-observe my-snap_2:log-observe - -
mount-observe my-snap_2:mount-observe - -
network-bind my-snap_2:network-bind :network-bind -
network-control my-snap_2:network-control - -
process-control my-snap_2:process-control - -
system-backup my-snap_2:system-backup - -
system-observe my-snap_2:system-observe - -
ubuntu@ip-172-31-59-113:~$
When I shell into the second snap, I’m unable to cd into $SNAP
directory.
ubuntu@ip-172-31-59-113:/snap$ cd $SNAP
bash: cd: /snap/my-snap/x1: No such file or directory
From the outside of the snap I see that the /snap/my-snap/
dir is indeed empty. When I tried this a month ago, however, the /snap/my-snap/
dir was redirecting to /snap/my-snap_2/
inside of the _2
snap.
Cannot remove an instance
ubuntu@ip-172-31-59-113:~$ sudo snap remove --purge my-snap_2
error: cannot perform the following tasks:
- Disconnect my-snap_2:network-control from core:network-control (internal error: connection "my-snap_2:network-control core:network-control" not found in state)
Layouts are only showing up in the original instance
After having trouble with the my-snap_2
instance, I tried just dealing with the my-snap_1
and my-snap
instances.
However, the layouts I assigned to the snap only show up in my-snap
. The $SNAP_DATA
directory of my-snap_1
is empty, unlike that of my-snap
.
Environment Variables are not working
The $SNAP_DATA
environment variable of my-snap_1
has the same value as that of my-snap
. When I shell in, I’m able to go to the “real” Snap Data directory by cd
'ing.
The fact that I’m able to see both Snap Data directories after shelling in is also odd.
/usr/bin
layout not working
I also had trouble with my /usr/bin/python3.7 -> $SNAP/usr/bin/python3.7
symlink, which had been working for a long time until now. I was able to remove that without issue, but it might serve as some clue. I don’t remember the error message.