Vanishing plugs

Today I booted and noticed that I have missing plugs

sergiusens@mirkwood:~$ cat /snap/telegram-sergiusens/current/meta/snap.yaml 
    command: command-telegram.wrapper
      QT_IM_MODULE: xim
      QT_XKB_CONFIG_ROOT: /usr/share/X11/xkb
    - home
    - network-manager
    - network
    - network-bind
    - pulseaudio
    - unity7
    - x11
- amd64
confinement: strict
description: |
  Telegram is a messaging app with a focus on speed and security, it's
  super-fast, simple and free. You can use Telegram on all your devices
  at the same time - your messages sync seamlessly across any number of
  your phones, tablets or computers.

  With Telegram, you can send messages, photos, videos and files of any
  type (doc, zip, mp3, etc), as well as create groups for up to 5000
  people or channels for broadcasting to unlimited audiences. You can
  write to your phone contacts and find people by their usernames. As a
  result, Telegram is like SMS and email combined - and can take care
  of all your personal or business messaging needs.
grade: stable
name: telegram-sergiusens
summary: A cloud-based messaging app with a focus on security and speed.
version: 1.1.19
sergiusens@mirkwood:~$ snap interfaces|grep telegram-sergiusens
sergiusens@mirkwood:~$ snap --version
snap    2.27.3+17.10
snapd   2.27.3+17.10
series  16
ubuntu  17.10
kernel  4.12.8-custom-surface

Any idea what is going on?
Other apps work fine

sergiusens@mirkwood:~$ snap interfaces|grep corebird
:gsettings                              corebird,keepassxc,rocketchat-desktop,simplenote
:home                                   corebird,docker,keepassxc,konversation,libreoffice,rocketchat-desktop,simplenote
:network                                corebird,docker,gping,keepassxc,konversation,libreoffice,rocketchat-desktop,simplenote
:opengl                                 corebird,keepassxc,konversation,libreoffice,rocketchat-desktop
:pulseaudio                             corebird,konversation,rocketchat-desktop,simplenote
:unity7                                 corebird,keepassxc,konversation,libreoffice,rocketchat-desktop,simplenote
:x11                                    corebird,keepassxc,konversation,rocketchat-desktop,simplenote
corebird:dbus-corebird                  -
-                                       corebird:network-observe

Doing a snap revert telegram-sergiusens and then a snap refresh telegram-sergiusens brought the plugs to the interface slots back, still worrying that these would just vanish.

Without further info, no idea really. As one might expect, plugs and slots should of course not just disappear or appear magically. If you have any other details or logs that might help identify what happened there, we might have a starting point.

I don’t see anything in the system logs and the snap change is no longer listed. Anything I should be looking for if I see this again?

We don’t manipulate interface connections without an explicit action doing something in the system. So whatever the reason, something will show up under snap changes when it does happen.

Ok, I have a new one, recently installed gnome-3-24

$ snap connect gnome-twitch:gnome-3-24-platform gnome-3-24:gnome-3-24-platform
error: snap "gnome-3-24" has no slot named "gnome-3-24-platform"
snap interfaces|grep gnome-3-24
-                                       gnome-twitch:gnome-3-24-platform
snap changes
ID   Status  Spawn                 Ready                 Summary
123  Done    2017-08-24T01:41:18Z  2017-08-24T01:45:04Z  Auto-refresh snap "snapcraft"
124  Error   2017-08-24T07:01:10Z  2017-08-24T07:11:54Z  Auto-refresh snap "lxd"
125  Error   2017-08-24T12:26:10Z  2017-08-24T12:36:58Z  Auto-refresh snap "lxd"
126  Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Install "gnome-3-24" snap
127  Done    2017-08-24T14:02:55Z  2017-08-24T14:04:42Z  Install "gnome-twitch" snap from "beta" channel
128  Done    2017-08-24T14:08:56Z  2017-08-24T14:08:56Z  Connect gnome-twitch:gnome-3-24-platform to gnome-3-24:gnome-3-24-platform
129  Error   2017-08-24T14:40:05Z  2017-08-24T14:40:45Z  Auto-refresh snap "lxd"
$ snap change 126
Status  Spawn                 Ready                 Summary
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:38Z  Download snap "gnome-3-24" (3) from channel "stable"
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:41Z  Fetch and check assertions for snap "gnome-3-24" (3)
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Mount snap "gnome-3-24" (3)
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Copy snap "gnome-3-24" data
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Setup snap "gnome-3-24" (3) security profiles
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Make snap "gnome-3-24" (3) available to the system
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Set automatic aliases for snap "gnome-3-24"
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Setup snap "gnome-3-24" aliases
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Run install hook of "gnome-3-24" snap if present
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Start snap "gnome-3-24" (3) services
Done    2017-08-24T13:55:01Z  2017-08-24T14:00:42Z  Run configure hook of "gnome-3-24" snap if present

$ snap change 128
Status  Spawn                 Ready                 Summary
Done    2017-08-24T14:08:56Z  2017-08-24T14:08:56Z  Run hook prepare-plug-gnome-3-24-platform of snap "gnome-twitch"
Done    2017-08-24T14:08:56Z  2017-08-24T14:08:56Z  Run hook prepare-slot-gnome-3-24-platform of snap "gnome-3-24"
Done    2017-08-24T14:08:56Z  2017-08-24T14:08:56Z  Connect gnome-twitch:gnome-3-24-platform to gnome-3-24:gnome-3-24-platform
Done    2017-08-24T14:08:56Z  2017-08-24T14:08:56Z  Run hook connect-slot-gnome-3-24-platform of snap "gnome-3-24"
Done    2017-08-24T14:08:56Z  2017-08-24T14:08:56Z  Run hook connect-plug-gnome-3-24-platform of snap "gnome-twitch"


$ grep -B1 gnome-3-24-platform /snap/gnome-3-24/current/meta/snap.yaml

@sergiusens These logs make no sense. The command line says the action failed, which only happens when the change errors, but the change in the logs show the task 128 as Done.

@pstolowski Do you have a moment to have a look into this?

we just discovered on IRC that @sergiusens runs a self-rolled kernel where bits of apparmor are missing … (so there isnt actually an issue here)

1 Like

That was indeed the case, just confused by the silent errors.

That said:

  • for the case of telegram I just reinstalled (when on my custom kernel), and it just worked.
  • for the case of gnome-twitch, I went into a ubuntu-kernel, installed and connected and now back on my custom kernel everything works.

@niemeyer I agree with your comments, I am fine with it not working, but everything mentions it is working while it really isn’t and while the case of a “custom” kernel is not common in Ubuntu it seems we might be treating everything !ubuntu-kernel as a custom kernel.

Yes, as long as you are running Ubuntu debs then that is the case.

So what is the story with solus, arch, fedora, opensuse and others? Are they considered custom kernels from a snapd perspective?

Interesting. Sure, I will look into why we report the error to cli while the change is reported as Done.

I didn’t have any luck in reproducing the issue of a failing snap connect ... with no errors reported by connect tasks (using current stable version of snapd, with gnome-3-24 and gnome-twitch snaps); I didn’t have a custom kernel. I looked at error propagation in the related code but couldn’t spot any problems (failure in any task should mark entire operation as failed).
@sergiusens can you provide any more details to reproduce your environment? Perhaps it would make sense to use the custom kernel you had?

@pstolowski you can download prebuilts here or rebuild. I suspect that using the mainline kernels might reproduce this as well

Still no luck with reproducing. I tried two kernels - mainline (4.4.14-040414.201606241434) and custom-surface:

pawel@ubuntu:~$ uname -a
Linux ubuntu 4.12.9-custom-surface #10 SMP Fri Aug 25 09:52:20 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
pawel@ubuntu:~$ snap interfaces |grep gnome-3-24
gnome-3-24:gnome-3-24-platform  gnome-twitch

When testing these two kernels I started with a clean slate (no gnome-3-24 nor gnome-twitch installed), then installed these two snaps and connected gnome-3-24-platform interface.

(both seem to have apparmor, no errors spotted, aa-status reports apparmor is enabled).

Just a quick remark: I stopped looking at this issue a week ago. No luck with reproducing. I’m happy to look at it again once there are any other clues.

Well, if I see it again, what would you want me to collect?

snapd & core snap version, name of the problematic snaps, ubuntu release, kernel version and url of the kernel binary if running a custom kernel. state.json might be useful too.