flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
25.04k stars 1.6k forks source link

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

Open Semnodime opened 2 years ago

Semnodime commented 2 years ago

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

borgmanJeremy commented 2 years ago

Is there actually a problem?

mmahmoudian commented 2 years ago

@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?

SubodhDahal commented 2 years ago

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"
mmahmoudian commented 2 years ago

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

mmahmoudian commented 2 years ago

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

SubodhDahal commented 2 years ago

@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.

pblanton commented 2 years ago

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)\" requestedreply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=1261 comm=\"/usr/sbin/NetworkManager --no-daemon \" label=\"unconfined\")" "Object path cannot be empty"

mmahmoudian commented 2 years ago

@pblanton read #2594

pblanton commented 2 years ago

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

borgmanJeremy commented 2 years ago

@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

SubodhDahal commented 2 years ago

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