flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

Bug: An AppArmor policy prevents this sender from sending this message to this recipient

Open Semnodime opened this issue 2 years ago • 11 comments

Flameshot Version

Flameshot v11.0.0 () Compiled with Qt 5.15.3

Installation Type

Snap from Snapcraft

Operating System type and version

Linux Mint 20 Cinnamon

Description

flameshot

->

Qt: Session management error: Could not open network socket
propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.263\" (uid=1000 pid=32914 comm=\"/snap/flameshot/180/usr/local/bin/flameshot \" label=\"snap.flameshot.flameshot (enforce)\") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=778 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.263\" (uid=1000 pid=32914 comm=\"/snap/flameshot/180/usr/local/bin/flameshot \" label=\"snap.flameshot.flameshot (enforce)\") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=778 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")"
"Object path cannot be empty"

Steps to reproduce

  1. Install Linux Mint 20 Cinnamon based
  2. Install snapd via apt
  3. Install flameshot via snap
  4. Run snap via flameshot in GnomeTerminal

Screenshots or screen recordings

No response

System Information

s.above Window Manager: Xorg

Semnodime avatar Jan 21 '22 20:01 Semnodime

Is there actually a problem?

borgmanJeremy avatar Jan 21 '22 21:01 borgmanJeremy

@borgmanJeremy I thought we have had similar issue before but I couldn't find it. I googled and got to a thread which led me to think that we are missing the dbus connection in documentation. What am I missing?

mmahmoudian avatar Jan 22 '22 07:01 mmahmoudian

I have the problem when I run flameshot gui and try to copy the selected screenshot into the clipboard. This causes the screenshot to not be copied to the clipboard. However, when I run just flameshot and click on the flameshot icon in the try then I can copy the screenshot to clipboard. I am also running Flameshot v11.0.0 installed via Snap on Ubuntu 21. I tried the AppImage version as well but I have the same problem, although the error message is different:

QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active
Failed to get information about the latest version.  "Host api.github.com not found"

SubodhDahal avatar Apr 22 '22 13:04 SubodhDahal

@SubodhDahal Did you forget to add the line about AppArmor? I cannot understand how your comment is related to this issue!

mmahmoudian avatar Apr 23 '22 10:04 mmahmoudian

this is most probably related to or identical to #1622 which as far as I understand boils down to https://snapcraft.io/docs/dbus-interface

mmahmoudian avatar May 10 '22 07:05 mmahmoudian

@mmahmoudian Yes, I had the same error as OP while using snap. Sorry, if it was not clear previously.

I had the same experience even when using the AppImage version too. But the error message was different. Not sure if it was due to the same underlying problem which might've been logged differently in snap and AppImage. That is why I included the error log from AppImage too.

SubodhDahal avatar May 10 '22 13:05 SubodhDahal

I just upgraded Flameshot to the latest version (11.0.0) on Ubuntu 21.10 and have run into the same issue. I have bound the [PrtSc] key to Flameshot with this command

"flameshot gui -p /home/my-username/Pictures/Screenshots"

But when I press the Print Screen key, I get a full-screen screenshot, like is the default behavior.

Entering the same command into the terminal gives me this error...

Qt: Session management error: Could not open network socket propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.2121" (uid=1000 pid=253413 comm="/snap/flameshot/180/usr/local/bin/flameshot gui -p" label="snap.flameshot.flameshot (enforce)") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination="org.freedesktop.NetworkManager" (uid=0 pid=1261 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.2121" (uid=1000 pid=253413 comm="/snap/flameshot/180/usr/local/bin/flameshot gui -p" label="snap.flameshot.flameshot (enforce)") interface="org.freedesktop.NetworkManager" member="GetDevices" error name="(unset)" requested_reply="0" destination="org.freedesktop.NetworkManager" (uid=0 pid=1261 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined")" "Object path cannot be empty"

pblanton avatar May 11 '22 04:05 pblanton

@pblanton read #2594

mmahmoudian avatar May 11 '22 04:05 mmahmoudian

How is my above comment with details about me having the exact same issue "OFF-TOPIC"????

pblanton avatar May 11 '22 15:05 pblanton

@pblanton It sounds like the issue you are describing (error on the CLI aside) is related to the gnome permission prompt. This issue is specifically discussing an issue on Mint that is likely related to the XDG portal on Cinnamon

borgmanJeremy avatar May 11 '22 15:05 borgmanJeremy

I have the problem when I run flameshot gui and try to copy the selected screenshot into the clipboard. This causes the screenshot to not be copied to the clipboard

UPDATE: I am not having the problem anymore on Flameshot v12.0.0 running on Ubuntu 22.04

SubodhDahal avatar Sep 08 '22 12:09 SubodhDahal