Disable / Enable not longer working when snap have GPIO Pins as connect

Hey Guys,

When I run

snap disable “sensornetworkconnector”

then

snap enable “sensornetworkconnector”

comes and error like this:

snap enable sensornetworkconnector
error: cannot perform the following tasks:
- Setup snap "sensornetworkconnector" (x1) security profiles (cannot setup apparmor for snap "sensornetworkconnector": cannot obtain apparmor specification for snap "sensornetworkconnector": lstat /sys/class/gpio/gpio18: no such file or directory)
- Setup snap "sensornetworkconnector" (x1) security profiles (cannot obtain apparmor specification for snap "sensornetworkconnector": lstat /sys/class/gpio/gpio18: no such file or directory)

core 16-2.33.1 4916 stable canonical core
pi2-kernel 4.4.0-1092.100 56 beta canonical kernel
pi3 16.04-0.5 x1 - - gadget

I also tested it on beta before same error, I know in the past it is was working.

syslog out:

Jul 20 11:00:08 EX0RMMR6 snapd[1207]: 2018/07/20 11:00:08.630403 handlers.go:377: Reported install problem for "sensornetworkconnector" as already-reported
Jul 20 11:00:16 EX0RMMR6 snapd[1207]: 2018/07/20 11:00:16.449868 snap.go:285: cannot get status of service "sensorconnector": cannot get service status: empty field "Type" in \u2018systemctl show\u2019 output
Jul 20 11:00:16 EX0RMMR6 rsyslogd-2007: action 'action 10' suspended, next retry is Fri Jul 20 11:01:16 2018 [v8.16.0 try http://www.rsyslog.com/e/2007 ]
Jul 20 11:00:30 EX0RMMR6 snapd[1207]: 2018/07/20 11:00:30.232534 handlers.go:377: Reported install problem for "sensornetworkconnector" as already-reported

A known bug?

Cheers

I am encountering similar issue with DELL Edge 3000 gateways. The refresh are failing with below error

$ snap refresh network-manager
error: cannot perform the following tasks:
- Setup snap "network-manager" (314) security profiles (cannot setup apparmor for snap "ccm-wda": cannot obtain apparmor specification for snap "ccm-wda": lstat /sys/class/gpio/gpio346: no such file or directory)
- Setup snap "network-manager" (314) security profiles (cannot obtain apparmor specification for snap "ccm-wda": lstat /sys/class/gpio/gpio346: no such file or directory)

Snap Info

$ snap version
snap    2.35.4
snapd   2.35.4
series  16
kernel  4.4.0-135-generic

Hello, is this happening with the edge channel of the core snap? This bug was recently fixed there, I believe.

Hey @zyga-snapd thanks for the info, I will check that later.

Greets

In my case all the snaps are from stable channel. I was able to refresh after a reboot. But Now I ended up with another issue

$ snap list core --all
Name  Version    Rev   Tracking  Publisher   Notes
core  16-2.35.2  5548  stable    canonical✓  core,disabled
core  16-2.35.4  5662  stable    canonical✓  core,disabled
core  16-2.36.1  5897  stable    canonical✓  core
$ snap list caracalla-kernel --all
Name              Version          Rev  Tracking  Publisher   Notes
caracalla-kernel  4.4.0-132.158-1  93   stable    canonical✓  kernel,disabled
caracalla-kernel  4.4.0-134.160-1  95   stable    canonical✓  kernel,disabled
caracalla-kernel  4.4.0-135.161-1  96   stable    canonical✓  kernel
$ snap refresh --list
error: cannot list updates: Post https://api.snapcraft.io/v2/snaps/refresh: http: error connecting
       to proxy %0A: dial tcp :0: getsockopt: connection refused

Hmm what is your current version of core? I don’t see the edge build that has this fix in the paste above.

Its 16-2.36.1 rev5897

hey @dhoomakethu @zyga-snapd

In the edge branch I didn’t see any gpio issues now.

Also to

it looks working in edge channel.

when are these fixes moving to the stable branch?

Greets

They are scheduled for 2.37 but perhaps it can be cherry picked into 2.36.2 as well CC @mvo for consideration.