Can't connect interfaces (so can't run snaps)

For some reason, interfaces are disconnected and not connectable on my laptop. (this may be related to this [other thread]{Snap connect returns "error: forbidden"}

alan@hal:~$ snap run gnome-calculator
You need to connect this snap to the gnome platform snap.

You can do this with those commands:
snap install gnome-3-26-1604
snap connect gnome-calculator:gnome-3-26-1604 gnome-3-26-1604
(the '3-26-1604' number defines the platform version and might change)

Pretty sure that should be auto-connected, and previously was…

alan@hal:~$ snap connect gnome-calculator:gnome-3-26-1604 gnome-3-26-1604

No reply, let’s assume that worked…?

alan@hal:~$ snap run gnome-calculator
You need to connect this snap to the gnome platform snap.

You can do this with those commands:
snap install gnome-3-26-1604
snap connect gnome-calculator:gnome-3-26-1604 gnome-3-26-1604

(the '3-26-1604' number defines the platform version and might change)

Nope. What do we do now which isn’t a) reboot, or b) remove and re-install the snap?

alan@hal:~$ snap version
snap    2.35.4
snapd   2.35.4
series  16
ubuntu  18.04
kernel  4.15.0-36-generic

FYI, I’m using core from stable

alan@hal:~$ snap info core
name:      core
summary:   snapd runtime environment
publisher: Canonical✓
contact:   snaps@canonical.com
license:   unset
description: |
  The core runtime environment for snapd
type:         core
snap-id:      99T7MUlRhtI3U0QFgl5mXXESAiSwt776
tracking:     stable
refresh-date: 5 days ago, at 23:51 BST
channels:                                            
  stable:    16-2.35.4                   (5662) 92MB -
  candidate: 16-2.35.5                   (5742) 92MB -
  beta:      16-2.35.5                   (5742) 92MB -
  edge:      16-2.36~pre2+git967.54466bd (5780) 92MB -
installed:   16-2.35.4                   (5662) 92MB core

I mentioned this to @kenvandine who suggested this wasn’t a problem with his snap, but likely a problem with snapd/core and we should ping @zyga-snapd - so :bellhop_bell: ding

@zyga-snapd this is probably the same as Gnome-calculator suddenly disconnected from gnome-platform-snap, reconnecting doesn't help

I suspect it happens after something refreshes, and in this case I bet it was gnome-3-26-1604 which I pushed an update for on Thursday.

Hi,

@kenvandine What’s you snap version ?

Also, in both cases (CC @popey) the output of snap changes and snap change <ID> (where ID is the one of a problematic change) as well as your state.json files will be invaluable in understanding what went wrong. Please send your state.json via PM or email as it contains sensitive bits.

The installation/update of those snaps has long rolled off the top of snap changes (when are we going to get a longer buffer on that?). However, I do have a single line for me doing snap connect gnome-calculator:gnome-3-26-1604 gnome-3-26-1604:gnome-3-26-1604 but the changes for it are empty.

180 Done yesterday at 15:35 BST yesterday at 15:35 BST Connect gnome-calculator:gnome-3-26-1604 to gnome-3-26-1604:gnome-3-26-1604

alan@hal:~$ snap change 180
Status  Spawn  Ready  Summary

alan@hal:~$```

Have sent you my state.json.

Thank you, investigating.

@popey, could you please attach the otuput of snap interfaces as well (let me know if you restared snapd inbetween, ideally I’d like to see the list of interfaces without snapd restart and when the issue is still visible).

Here’s my snap interfaces http://paste.ubuntu.com/p/cs3dFBTJQg/
I don’t think I have restarted snapd recently.
I just tried restarting snapd and here’s the snap interfaces now http://paste.ubuntu.com/p/z54TrJ88c8/

They look the same to me, and the issue is still there.

$ snap run gnome-calculator
You need to connect this snap to the gnome platform snap.

You can do this with those commands:
snap install gnome-3-26-1604
snap connect gnome-calculator:gnome-3-26-1604 gnome-3-26-1604

(the '3-26-1604' number defines the platform version and might change)

1 Like

Thanks for that, may I ask you to also collect the following (paste directly or pastebin here):

  1. Cat the two /var/lib/snapd/mount/snap.gnome-calculator*fstab files.
  2. Enter the namespace of the snap: sudo nsenter -m/run/snapd/ns/gnome-calculator.mnt
  3. While in the namespace cat /run/snapd/ns/snap.gnome-calculator.fstab
  4. Still in the namespace, cat /proc/$$/mountinfo

Thank you!

We need the files that Pawel asked for above rather than the state file to determine if the interface connection is really present or present but misbehaving. Once you have that we can look at what the possible cause is.

alan@hal:~$ sudo nsenter -m/run/snapd/ns/gnome-calculator.mnt
[sudo] password for alan: 
-bash: /usr/bin/locale-check: No such file or directory
root@hal:/# cat /run/snapd/ns/snap.gnome-calculator.fstab
root@hal:/# cat /proc/$$/mountinfo

It appears that 29062 29058 7:22 /gnome-platform /snap/gnome-calculator/238/gnome-platform ro,nodev,relatime master:53 - squashfs /dev/loop22 ro the platform snap is mounted. What is the exact condition checked by the startup scripts to print the message you are seeing?

PS: As a tip for the future, it is easier to look at /prof/self/mountinfo inside the mount namespace (after using nsenter) since there are less things to worry about with regards to quoting.

1 Like

My system exploded when I exited from nsenter. I have now rebooted and the snaps that previously didn’t work, now work :frowning:

@zyga-snapd: The desktop-launch scirpt does this:

###########################
# GNOME runtime selection #
###########################

if [ -d $SNAP/gnome-platform ]; then
  RUNTIME=$SNAP/gnome-platform
  if [ ! -d $RUNTIME/usr ]; then
    echo "You need to connect this snap to the gnome platform snap."

gnome-platform is not mounted in the root filesystem.

29062 29058 7:22 /gnome-platform /snap/gnome-calculator/238/gnome-platform ro,nodev,relatime master:53 - squashfs /dev/loop22 r

This roughly reads: the /gnome-platform directory of /dev/loop22 is mounted at /snap/gnome-calculator/238/gnome-platform with the following options and sharing …

We’ve had another report of the same issue Gnome-calculator problem

This was fixed in master. The fix was backported to 2.36, currently in beta. As a workaround discard the mount namespace (using /use/lib/snapd/snap-discard-ns) and refresh core to beta.

2 Likes

That’s great to hear, thanks!