dynobo / normcap

OCR powered screen-capture tool to capture information instead of images
https://dynobo.github.io/normcap/
Other
1.8k stars 91 forks source link

[Linux] Crash due to "Timeout when taking screenshot" #558

Closed MariusAlbrecht closed 5 months ago

MariusAlbrecht commented 7 months ago

What happened?

honestly dunno for the exception. This:

12:07:27 - ERROR   - normcap.screengrab.dbus_portal:88 - No response from xdg-portal within 7s!
12:07:27 - WARNING - normcap.screengrab.dbus_portal:199 - Timeout when taking screenshot!
12:07:27 - WARNING - normcap.screengrab.dbus_portal:204 - Didn't receive screenshot! Are permissions missing or did you cancel the intermediate dialog?

appears after opening the "options"

How did you install NormCap?

Python Package (pip install)

Operating System + Version?

Ubuntu 23.04

[Linux only] Display Server (DS) + Desktop environment (DE)?

Wayland, Gnome

Debug log output?*

`$ normcap
12:07:27 - ERROR   - normcap.screengrab.dbus_portal:88 - No response from xdg-portal within 7s!
12:07:27 - WARNING - normcap.screengrab.dbus_portal:199 - Timeout when taking screenshot!
12:07:27 - WARNING - normcap.screengrab.dbus_portal:204 - Didn't receive screenshot! Are permissions missing or did you cancel the intermediate dialog?
12:07:27 - ERROR   - normcap.gui.tray:428 - Could not grab screenshot.
12:07:30 - ERROR   - normcap.screengrab.dbus_portal:103 - Error code 1 received from xdg-portal!
12:07:30 - CRITICAL - normcap:161 - Uncaught exception! Quitting NormCap!

### System:

{  'cli_args': '/home/REDACTED/.local/bin/normcap',
   'config_directory': PosixPath('/home/REDACTED/.config/normcap'),
   'desktop_environment': <DesktopEnvironment.UNITY: 4>,
   'display_manager_is_wayland': True,
   'envs': {'LD_LIBRARY_PATH': None, 'TESSDATA_PREFIX': None},
   'is_briefcase_package': False,
   'is_flatpak_package': False,
   'normcap_version': '0.4.4',
   'platform': 'linux',
   'pyside6_version': '6.5.1',
   'qt_library_path': '/home/REDACTED/.local/lib/python3.10/site-packages/PySide6/Qt/plugins, '
                      '/usr/bin',
   'qt_version': '6.5.1',
   'ressources_path': PosixPath('/home/REDACTED/.local/lib/python3.10/site-packages/normcap/resources'),
   'screens': [  Screen(is_primary=True,
                        device_pixel_ratio=1.0,
                        rect=Rect(left=0, top=0, right=1920, bottom=1080),
                        index=0,
                        screenshot=None)],
   'tessdata_path': None,
   'tesseract_path': PosixPath('/usr/bin/tesseract')}

Variables:

                    'code': 1,
                    'message': <PySide6.QtDBus.QDBusMessage(type=Signal, service=":1.89", path="/org/freedesktop/portal/desktop/request/1_603/normcap_cfdhfchf", interface="org.freedesktop.portal.Request", member="Response", signature="ua{sv}", contents=(1, [Argument: a{sv} {}]) ) at 0x7fc116544800>,
                    'msg': 'Error code 1 received from xdg-portal!',
                    'self': 'REDACTED'}}

Exception:

  IndexError: list index out of range

Traceback:

  File "/home/REDACTED/.local/lib/python3.10/site-packages/normcap/screengrab/dbus_portal.py", line 107, in got_signal
    uri = str(message).split('[Variant(QString): "')[1]

12:07:30 - CRITICAL - normcap:192 - Please open an issue with the output above on https://github.com/dynobo/normcap/issues`

dynobo commented 7 months ago

Hi @MariusAlbrecht, thanks for reporting this problem!

It looks very similar to what was reported in https://github.com/dynobo/normcap/issues/555 . Would you agree? Shall we close this issue here as duplicate, and continue in that earlier issue?

MariusAlbrecht commented 7 months ago

I honestly did only 'follow orders' and didn't check for duplicates like I normally would when opening an issue. In hindsight that wasn't very reasonable I'll take a look and edit this response in probably about 15min

edit: could very well be the same issue! at least the latter part I wanna empathise the first few lines again where an error appears after only opening the options (and especially not actively trying to take a screenshot). I cannot judge whether that could be the same issue concerning screenshots (seems like it but I don't know the app internals)

dynobo commented 6 months ago

Hi @MariusAlbrecht , could you please check if this problem persists with the latest release? (At least the potential duplicate #555 got solved with the latest update...)

MariusAlbrecht commented 6 months ago

will try that in the next few days ✨

MariusAlbrecht commented 6 months ago

Did some testing and all seems to work well now. Installed via flatpak tho