Auto-connect ksnip to network-observe and network-manager-observe

Hello,

is it possible to get ksnip auto-connected to network-observe and network-manager-observe?
Ksnip is a screenshot and annotation tool and allows uploading screenshots and images to Imgur.com, for that we use those two observers.

Best regards,
Damir

What does ksnip use the ability to see the network configuration for? Does ksnip work at all without the interfaces connected?

The strange think is that it work and we only came to ask for the auto-connect because the console is spammed with:

Could not create AF_NETLINK socket (Permission denied)

Connection those two silences the output. Also interesting, I have seen this message only on Ubuntu, on my OpenSUSE it doesn’t appear.

Regarding the network manager, we don’t access any network configuration directly, it’s probably one of the Qt components, probably QNetworkAccessManager which we use to send the request to imgur.com

@lucyllewy I tried rebuilding without network-manager-observe, and this is the “error” that is not silenced:

propsReply “An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=”:1.245" (uid=1000 pid=55164 comm="/snap/ksnip/x1/bin/ksnip " label=“snap.ksnip.ksnip (enforce)”) interface=“org.freedesktop.DBus.Properties” member=“GetAll” error name="(unset)" requested_reply=“0” destination=“org.freedesktop.NetworkManager” (uid=0 pid=2671 comm="/usr/sbin/NetworkManager --no-daemon " label=“unconfined”)"
nmReply “An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=”:1.245" (uid=1000 pid=55164 comm="/snap/ksnip/x1/bin/ksnip " label=“snap.ksnip.ksnip (enforce)”) interface=“org.freedesktop.NetworkManager” member=“GetDevices” error name="(unset)" requested_reply=“0” destination=“org.freedesktop.NetworkManager” (uid=0 pid=2671 comm="/usr/sbin/NetworkManager --no-daemon " label=“unconfined”)"
“Object path cannot be empty”

The program works fine without the plugs…
The AF_NETLINK issue is solved by including the network-observe plug (appartently the network one is not sufficient).

Qt has a few different ways to detect network status. One uses network-manager and another, as of 5.11 requires network-observe (another does not require either).

@damir - I’m inclined to vote +1 for this but curious why your application is using both methods?

Not sure why both are needed, as @LyzardKing said, we were trying to silence error messages written to the console and as far as I understand, adding both silenced that errors above. Maybe we could try removing one of them and see if it’s still working.

Network related we use the QNetworkAccessManager and from there the post method and the finished slot. Nothing special to be honest.

Another think that we do is opening Urls in the default browser (imgurg responses), but that is probably not related?

Please do and report back.

It shouldn’t be related, no.

I tried, and it needs both plugs to correctly silence the messages.
The network-observe is needed to silence the AF_NETLINK log,
and network-manager-observe is needed for the apparmor log, as nored in the previous messages.

@jdstrand how should we proceed here?

Any feedback regarding our request?

Did you do and then report back as requested by @jdstrand?

Specifically @jdstrand was replying to

Yes, as @LyzardKing wrote, he tried with only one at the time and that was not enough to silence the alarms. Only enabling both did silence the alarms.

This looks similar to this issue with the moonlight snap, where an update to Qt 5.12 caused networking issues. Snapd 2.45.1 should fix it with an updated network interface.

@damir - would you be able to test this by installing the snapd snap in beta (sudo snap refresh snapd --beta) and getting back to us?

@jdstrand I can test it… I’ll remove the apt installed version of snapd and install the snap beta version

@jdstrand @maxiberta @damir
I tested with the new beta version of snapd and it seems to work without the additional plugs.
So simply using network is fine now…

Great! network is autoconnected and 2.45.1 is now in the stable channel. Removing this request from the review queue.