Snap has errors when built on 22.04

Hi,

I need to get the ip address of the machine in my app. I was successfully building snaps upto ubuntu 20.04 (maybe my snaps were only working till 20.04). I am trying to build in ubuntu 22.04 and there are snap interface permission errors. Snappy-debug asks me to add network-manager or network-manager-observe to get rid of the errors but it doesn’t work at all.

Info:

  • it’s a flutter app.
  • building using lxd.
  • network_info_plus, nm, networkd packages don’t seem to work.
  • adding all of the network interfaces in plugs section doesn’t work.
  • just having network, home, network-manager doesn’t work.
  • just having network, home, network-manager-observe doesn’t work.

snappy-debug only asks to add those. errors:

= AppArmor =

Time: Apr  4 18:48:54

Log: apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop/network1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name="org.freedesktop.network1" pid=142068 label="snap.quickit.quickit"

DBus access
= AppArmor =

Time: Apr  4 18:48:54

Log: apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/org/freedesktop" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.freedesktop.NetworkManager" pid=142068 label="snap.quickit.quickit" peer_pid=712 peer_label="unconfined"

DBus access

Any help is much appreciated.

did you actually connect the interfaces after installing the snap ? IIRC the network-manager-* ones are not auto-connecting …

I am sorry, I am not aware of what that is. Can you please point me to the relevant documentation?

see snap help connect… you will likely need:

sudo snap connect quickit:network-manager-observe (or network-manager depending what plug you have defined) … if it works you can request auto-connection for your snap in the store-requests category here on this forum, so users do not need to do this manual step …

Oh, thanks, let me try :slight_smile: This should probably be added in the supported interfaces table in the documentation.

Thanks @ogra that worked. How do I make sure that the app is only available after the auto connection is enabled? Do I keep it in the edge channel until then? Just want to make sure that no user faces this error.

yes, keep it in the edge channel and file a request for auto-connect … take a look at the store-requests category here:

… and just look at some other auto-connection request posts to see an example …

1 Like