flameshot icon indicating copy to clipboard operation
flameshot copied to clipboard

Flameshot does not open no errors

Open cvanelteren opened this issue 3 years ago • 30 comments

Version 0.9.0

Describe the bug

nothing happens and no output

  • Running flameshot gives me the sys tray icon but nothing happens
  • flameshot gui does nothing
  • flameshot config does nothing

To Reproduce

sudo pacman -S flameshot

Expected behavior

Capture screenshot System Information Linux 5.11.2 sway version 1.6-1a72049c

cvanelteren avatar Apr 12 '21 16:04 cvanelteren

more info from journalctl

Apr 20 16:52:51 g14 flameshot[50154]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                                      
                                      Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
                                      
                                      Apr 20 16:54:40 g14 flameshot[56653]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Apr 20 16:54:40 g14 audit[56653]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=2 subj==unconfined pid=56653 comm="flameshot" exe="/usr/bin/flameshot" sig=6 res=1
Apr 20 1
6:54:40 g14 flameshot[56653]: qt.qpa.xcb: could not connect to display

edit: I reinstalled the git version from aur but similar error.

cvanelteren avatar Apr 20 '21 14:04 cvanelteren

Linux 5.11.16-arch1-1 Openbox X11

Same error.


Apr 24 16:18:25 redmi dbus-daemon[7929]: [session uid=1000 pid=7929] Activating service name='org.flameshot.Flameshot' requested by ':1.2626' (uid=1000 pid=176580 comm="flameshot gui ")
Apr 24 16:18:25 redmi flameshot[176583]: qt.qpa.xcb: could not connect to display
Apr 24 16:18:25 redmi flameshot[176583]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Apr 24 16:18:25 redmi flameshot[176583]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                                         
                                         Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Apr 24 16:18:25 redmi systemd-coredump[176587]: Process 176583 (flameshot) of user 1000 dumped core.
                                                
                                                Stack trace of thread 176583:
                                                #0  0x00007fec9d8cdef5 raise (libc.so.6 + 0x3cef5)
                                                #1  0x00007fec9d8b7862 abort (libc.so.6 + 0x26862)
                                                #2  0x00007fec9de4d9ac _ZNK14QMessageLogger5fatalEPKcz (libQt5Core.so.5 + 0x909ac)
                                                #3  0x00007fec9e445646 _ZN22QGuiApplicationPrivate25createPlatformIntegrationEv (libQt5Gui.so.5 + 0x131646)
                                                #4  0x00007fec9e445ae1 _ZN22QGuiApplicationPrivate21createEventDispatcherEv (libQt5Gui.so.5 + 0x131ae1)
                                                #5  0x00007fec9e07a2e6 _ZN23QCoreApplicationPrivate4initEv (libQt5Core.so.5 + 0x2bd2e6)
                                                #6  0x00007fec9e448b20 _ZN22QGuiApplicationPrivate4initEv (libQt5Gui.so.5 + 0x134b20)
                                                #7  0x00007fec9eb426ba _ZN19QApplicationPrivate4initEv (libQt5Widgets.so.5 + 0x15f6ba)
                                                #8  0x0000564927a82e21 n/a (flameshot + 0xaee21)
                                                #9  0x0000564927a1abb5 n/a (flameshot + 0x46bb5)
                                                #10 0x00007fec9d8b8b25 __libc_start_main (libc.so.6 + 0x27b25)
                                                #11 0x0000564927a1d8ee n/a (flameshot + 0x498ee)
░░ Subject: Process 176583 (flameshot) dumped core
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ Documentation: man:core(5)
░░ 
░░ Process 176583 (flameshot) crashed and dumped core.
░░ 
░░ This usually indicates a programming error in the crashing program and
░░ should be reported to its vendor as a bug.
Apr 24 16:18:25 redmi dbus-daemon[7929]: [session uid=1000 pid=7929] Activated service 'org.flameshot.Flameshot' failed: Process org.flameshot.Flameshot received signal 6

enesaltinkaya avatar Apr 24 '21 13:04 enesaltinkaya

Experiencing same issue on Arch running wayland. Kernel: 5.11.16-arch1-1 WM: Swaywm 1.6 (stable)

proudmuslim-dev avatar Apr 24 '21 18:04 proudmuslim-dev

Do the tips here help? https://github.com/flameshot-org/flameshot/pull/1272

borgmanJeremy avatar Apr 26 '21 18:04 borgmanJeremy

@borgmanJeremy

export $XDG_CURRENT_DESKTOP=sway && flameshot gui produces the same error for me.

cvanelteren avatar Apr 26 '21 18:04 cvanelteren

paging @nullobsi who did the sway implementation.

borgmanJeremy avatar Apr 27 '21 18:04 borgmanJeremy

hmm, flameshot is dbus activated right? flameshot gui just calls the dbus interface to open the currently running instance.

if you do XDG_CURRENT_DESKTOP=sway flameshot with no gui, I wonder if it would work... if it does, the solution is to add exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP and exec dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP so that the dbus-activation has the proper variables needed

nullobsi avatar Apr 27 '21 19:04 nullobsi

this occurs because sway doesn't automatically update the systemd activation environment. so when flameshot gui requests activation of flameshot, it doesn't have XDG_CURRENT_DESKTOP or WAYLAND_DISPLAY set, so it falls back to X11, which also doesn't have a DISPLAY variable. adding the two lines to the sway config, or your launch script (without the exec) should solve any problems.

nullobsi avatar Apr 27 '21 19:04 nullobsi

I get the same thing.

XDG_CURRENT_DESKTOP=sway flameshot starts flameshot successfully, but clicking the tray icon prints Wayland does not support QWindow::requestActivate(), which is strange. Setting QT_QPA_PLATFORM=xcb removes the requestActivate warning, but still doesn't do anything.

Tried most of the tips in #675, still no luck. Interestingly the logs for xdg-desktop-portal-wlr shows execvp: No such file or directory, which makes no sense.

Running latest flameshot-git.

RealOrangeOne avatar Apr 27 '21 20:04 RealOrangeOne

@nullobsi for me flameshot in shell produces an app icon that I can click on but it does not open anything. Even with the xdg flag set.

cvanelteren avatar Apr 27 '21 20:04 cvanelteren

@RealOrangeOne , xdg-desktop-portal-wlr uses grim to take a screenshot, so you should be sure you have grim installed as well. that's what I think the failed execvp call is.

@cvanelteren , this also sounds like a dbus activation error. if it tries to get a screenshot from xdpw, and receives no response, it will "hang" until you quit the app and get a bunch of failed screenshot notifications.

one last thing, the requestActivate error is completely unrelated. it happens to almost all Qt apps on Wayland, and is normally harmless (windows cannot bring themselves up on wayland)

nullobsi avatar Apr 27 '21 20:04 nullobsi

perhaps flameshot should have a wiki page for wlroots support. :)

nullobsi avatar Apr 27 '21 20:04 nullobsi

XDG_CURRENT_DESKTOP=sway flameshot                                                 (base) 
QSettings::value: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed
QSettings::value: Empty key passed
QSettings::setValue: Empty key passed

Is the output I get with an icon but nothing happens what I click on on the menu.

EDIT: just to clarify things like about does open, however take screenshot does nothing.

cvanelteren avatar Apr 27 '21 20:04 cvanelteren

Journal ctl is empty however when I do that

cvanelteren avatar Apr 27 '21 20:04 cvanelteren

perhaps flameshot should have a wiki page for wlroots support. :)

Thinking the same thing. I can write it and have you review it. Or if you want to submit a PR that would be great.

borgmanJeremy avatar Apr 27 '21 20:04 borgmanJeremy

i will probably make a PR later.

@cvanelteren , please make sure you've imported the activation environment as described above, and restart xdg-desktop-portal and flameshot by killing it

nullobsi avatar Apr 27 '21 20:04 nullobsi

Not sure I understand. Restarting the service with the environment set does not change anything for me. What do you mean exactly?

cvanelteren avatar Apr 27 '21 20:04 cvanelteren

export XDG_CURRENT_DESKTOP=sway
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
pkill xdg-desktop-portal
pkill flameshot

the two first commands and the export signal to systemd the environment variables for the display, and current desktop. kill the xdp, and flameshot, so that next time systemd starts them, they will inherit the correct environment variables

nullobsi avatar Apr 27 '21 20:04 nullobsi

xdg-desktop-portal-wlr uses grim to take a screenshot, so you should be sure you have grim installed as well

Holy balls that actually worked! Thanks!

RealOrangeOne avatar Apr 27 '21 20:04 RealOrangeOne

No dice for me. I also have grim installed fyi. Do you need any info from my end that I can provide?

cvanelteren avatar Apr 27 '21 21:04 cvanelteren

@cvanelteren , all I can think of is try running xdg-desktop-portal like XDG_CURRENT_DESKTOP=sway /usr/lib/xdg-desktop-portal -v and make sure it loads xdpw

you may also have to kill the old instance first

nullobsi avatar Apr 28 '21 03:04 nullobsi

Not an expert here; XDG_CURRENT_DESKTOP=SWAY /usr/lib/xdg-desktop -v returns this

output

XDP: load portals from /usr/share/xdg-desktop-portal/portals
XDP: loading /usr/share/xdg-desktop-portal/portals/wlr.portal
XDP: portal implementation for sway, Wayfire, river
XDP: portal implementation supports org.freedesktop.impl.portal.Screenshot
XDP: portal implementation supports org.freedesktop.impl.portal.ScreenCast
XDP: loading /usr/share/xdg-desktop-portal/portals/gnome-shell.portal
XDP: portal implementation for gnome
XDP: portal implementation supports org.freedesktop.impl.portal.Access
XDP: providing portal org.freedesktop.portal.MemoryMonitor
XDP: providing portal org.freedesktop.portal.NetworkMonitor
XDP: providing portal org.freedesktop.portal.ProxyResolver
XDP: providing portal org.freedesktop.portal.Trash
XDP: providing portal org.freedesktop.portal.GameMode

** (/usr/lib/xdg-desktop-portal:10703): WARNING **: 10:23:28.721: No skeleton to export
XDP: Using wlr.portal for org.freedesktop.impl.portal.Screenshot in sway

** (/usr/lib/xdg-desktop-portal:10703): WARNING **: 10:23:53.746: Failed to create screenshot proxy: Error calling StartServiceByName for org.freedesktop.impl.portal.desktop.wlr: Timeout was reached

** (/usr/lib/xdg-desktop-portal:10703): WARNING **: 10:23:53.746: No skeleton to export
XDP: Falling back to gnome-shell.portal for org.freedesktop.impl.portal.Access
XDP: providing portal org.freedesktop.portal.Device
XDP: providing portal org.freedesktop.portal.Location
XDP: providing portal org.freedesktop.portal.Camera
XDP: Using wlr.portal for org.freedesktop.impl.portal.ScreenCast in sway

** (/usr/lib/xdg-desktop-portal:10703): WARNING **: 10:24:18.779: Failed to create screen cast proxy: Error calling StartServiceByName for org.freedesktop.impl.portal.desktop.wlr: Timeout was reached

** (/usr/lib/xdg-desktop-portal:10703): WARNING **: 10:24:18.779: No skeleton to export
XDP: org.freedesktop.portal.Desktop acquired

It hangs however quite a long time on the first error and finally aquires XDP eventually

cvanelteren avatar Apr 28 '21 08:04 cvanelteren

I must add that for some reasons the wlr service nerver starts

● xdg-desktop-portal-wlr.service - Portal service (wlroots implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-wlr.service; static)
     Active: failed (Result: exit-code) since Wed 2021-04-28 10:33:07 CEST; 19s ago
    Process: 11159 ExecStart=/usr/lib/xdg-desktop-portal-wlr (code=exited, status=1/FAILURE)
   Main PID: 11159 (code=exited, status=1/FAILURE)

Apr 28 10:33:06 g14 systemd[1178]: Failed to start Portal service (wlroots implementation).
Apr 28 10:33:07 g14 systemd[1178]: xdg-desktop-portal-wlr.service: Scheduled restart job, restart counter i>
Apr 28 10:33:07 g14 systemd[1178]: Stopped Portal service (wlroots implementation).
Apr 28 10:33:07 g14 systemd[1178]: xdg-desktop-portal-wlr.service: Start request repeated too quickly.
Apr 28 10:33:07 g14 systemd[1178]: xdg-desktop-portal-wlr.service: Failed with result 'exit-code'.
lines 1-11

cvanelteren avatar Apr 28 '21 08:04 cvanelteren

The wlr service also didn't start for me but https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist fixed it

the-blank-x avatar Apr 28 '21 11:04 the-blank-x

Thanks for the link. WLR is now running but error still remains and flameshot gui still produces the errors above

cvanelteren avatar Apr 28 '21 18:04 cvanelteren

For other people with this issue, I have in the meantime switched to grimshot which albeit less powerful, works for sway-wm. Will check in a bit when the landscape changes for flameshot and xdg-desktop-portal.

cvanelteren avatar May 01 '21 12:05 cvanelteren

Flameshot does not open in Elementary 6.1 built on Ubuntu 20.04.3 LTS when installed via Elementary's App Store.

cedewey avatar Jul 31 '22 18:07 cedewey

@cedewey this is a sway-specific thread and I doubt that the same phenomenon is happening over on your setup (unless you are on Sway). I therefore mark yours as off-topic. if it does not open, try kill-all flameshot && flameshot gui in terminal and let us know the output.

mmahmoudian avatar Jul 31 '22 19:07 mmahmoudian

I have the same problem. flameshot gui doesn't work and there's no output

Flameshot version: Flameshot v12.1.0 (001726a5) Compiled with Qt 5.15.5 DE: sway version 1.7

5GameMaker avatar Sep 03 '22 09:09 5GameMaker

@5GameMaker have you read and follow this documentation? https://github.com/flameshot-org/flameshot/blob/master/docs/Sway%20and%20wlroots%20support.md

mmahmoudian avatar Sep 03 '22 10:09 mmahmoudian