Activitywatch: Can't open dashboard from tray icon

Created on 26 Jun 2018  Â·  21Comments  Â·  Source: ActivityWatch/activitywatch

I'm on archlinux (kde plasma), running the latest version installed via aur (activitywatch-bin 0.8.0b3-2).

activitywatch starts fine and the trayicon is displayed, but when I click on _open dashboard_ noting happens.
There also isn't anythin bad in the log:

2018-06-26 11:28:10 [INFO ]: Starting module aw-server  (aw_qt.manager:46)
2018-06-26 11:28:10 [INFO ]: Starting module aw-watcher-afk  (aw_qt.manager:46)
2018-06-26 11:28:10 [INFO ]: Starting module aw-watcher-window  (aw_qt.manager:46)
2018-06-26 11:28:10 [INFO ]: Creating trayicon...  (aw_qt.trayicon:150)
2018-06-26 11:28:35 [INFO ]: Stopped module aw-server  (aw_qt.manager:79)
2018-06-26 11:28:35 [INFO ]: Stopped module aw-watcher-afk  (aw_qt.manager:79)
2018-06-26 11:28:35 [INFO ]: Stopped module aw-watcher-window  (aw_qt.manager:79)

When running aw-qt from the commandline there are errors though:

patrick:~ $ aw-qt 
2018-06-26 11:28:10 [INFO ]: Starting module aw-server  (aw_qt.manager:46)
2018-06-26 11:28:10 [INFO ]: Starting module aw-watcher-afk  (aw_qt.manager:46)
2018-06-26 11:28:10 [INFO ]: Starting module aw-watcher-window  (aw_qt.manager:46)
2018-06-26 11:28:10 [INFO ]: Creating trayicon...  (aw_qt.trayicon:150)
fatal: not a git repository (or any of the parent directories): .git
Unable to get current commit with git
2018-06-26 11:28:10 [INFO ]: aw-watcher-window started  (aw_watcher_window.main:42)
2018-06-26 11:28:10 [INFO ]: aw-watcher-afk started  (aw_watcher_afk.afk:53)
2018-06-26 11:28:10 [INFO ]: Using storage method: peewee  (aw_server.main:26)
2018-06-26 11:28:10 [INFO ]: Starting up...  (aw_server.main:31)
2018-06-26 11:28:10 [INFO ]: Using database file: /home/patrick/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db  (aw_datastore.storages.peewee:111)
 * Serving Flask app "aw-server" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
2018-06-26 11:28:10 [INFO ]:  * Running on http://localhost:5600/ (Press CTRL+C to quit)  (werkzeug:88)
2018-06-26 11:28:11 [INFO ]: Connection to aw-server established by aw-watcher-window  (aw_client.client:334)
2018-06-26 11:28:11 [INFO ]: Connection to aw-server established by aw-watcher-afk  (aw_client.client:334)
Opening dashboard
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by kde-open5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5KIOWidgets.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5KIOCore.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5I18n.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5CoreAddons.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5JobWidgets.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5Service.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5Completion.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5IconThemes.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5WindowSystem.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5ConfigWidgets.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5WidgetsAddons.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5ConfigGui.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5ConfigCore.so.5)
kde-open5: /opt/activitywatch/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libQt5Xml.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libQt5Xml.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5DBusAddons.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5Auth.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libQt5X11Extras.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5Archive.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5ItemViews.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5Codecs.so.5)
kde-open5: /opt/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/libKF5GuiAddons.so.5)

CShutdown initiated, stopping all services...
2018-06-26 11:28:35 [INFO ]: Stopped module aw-server  (aw_qt.manager:79)
2018-06-26 11:28:35 [INFO ]: Stopped module aw-watcher-afk  (aw_qt.manager:79)
2018-06-26 11:28:35 [INFO ]: Stopped module aw-watcher-window  (aw_qt.manager:79)

It looks like it can't find the correct version (5.11) of qt, but it is installed:

patrick:~ $ qtdiag
Qt 5.11.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.1.1 20180531) on "xcb" 
OS: Arch Linux [linux version 4.17.2-1-ARCH]
help wanted linux pyinstaller bug

Most helpful comment

Here's the issue:

https://github.com/ActivityWatch/aw-qt/blob/9a98933d9f4a7f6c978d947b05809020d7c71c3e/aw_qt/trayicon.py#L19..L26

When webbrowser.open is called it calls subprocess.Popen to start the browser process to handle the URL open request. The problem here is that LD_LIBRARY_PATH is set by PyInstaller for the built executables, which leads to trouble that the PyInstaller folks explicitly warn about.

Now the problem is how to unset LD_LIBRARY_PATH for the subprocess.Popen call made by webbrowser.open. An alternative is to avoid using webbrowser.open and instead directly call xdg-open using subprocess.Popen with properly (re)set LD_LIBRARY_PATH as done in the PyInstaller docs.

Since I don't have a machine where I can repro/test this, I'll leave it to someone else.

All 21 comments

Looks like it could be related, is there any more information I can provide?
--verbose isn't implemented for aw-qt so I hope the console log above is enough.

After building activitywatch from source the problem no longer occurs.
Would be very interesting what causes the problem with the binary from the AUR.

@pahofmann Could you try running it after this command? (long shot)

unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH

Found relevant discussion here: https://github.com/AlbrechtL/welle.io/issues/90

The PyQt version used by aw-qt in v0.8.0b3 is v5.10 (see the relevant line in the build here). So your error is essentially that your system's Qt5 installation is requring things from aw-qt, but aw-qt shouldn't be loading your system's Qt5 libraries to begin with, so something is definitely weird.

I reinstalled the current AUR package and tried it after running the command, unfortunately no difference.

Seems like on KDE, webbrowser.open somehow invokes system KF5 (KDE) libraries, which in turn might be linked against different version of Qt

Opening dashboard
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by kde-open5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5KIOWidgets.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5KIOCore.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5I18n.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5CoreAddons.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5JobWidgets.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5Service.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5Completion.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5IconThemes.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5WindowSystem.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5ConfigWidgets.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5WidgetsAddons.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5ConfigGui.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5ConfigCore.so.5)
kde-open5: /home/jazz/bin/activitywatch/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib64/libQt5Xml.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libQt5Xml.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5DBusAddons.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5Auth.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libQt5X11Extras.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5Archive.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5ItemViews.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5Codecs.so.5)
kde-open5: /home/jazz/bin/activitywatch/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib64/libKF5GuiAddons.so.5)

When building from source this behavior is not exhibited because aw-qt is using system version of Qt

I have the same problem on KDE Neon (Ubuntu 16.04 base + latest KDE) when running from tarball.

(Workaround is of course to open http://localhost:5600 manually, which works fine.)

Here's the issue:

https://github.com/ActivityWatch/aw-qt/blob/9a98933d9f4a7f6c978d947b05809020d7c71c3e/aw_qt/trayicon.py#L19..L26

When webbrowser.open is called it calls subprocess.Popen to start the browser process to handle the URL open request. The problem here is that LD_LIBRARY_PATH is set by PyInstaller for the built executables, which leads to trouble that the PyInstaller folks explicitly warn about.

Now the problem is how to unset LD_LIBRARY_PATH for the subprocess.Popen call made by webbrowser.open. An alternative is to avoid using webbrowser.open and instead directly call xdg-open using subprocess.Popen with properly (re)set LD_LIBRARY_PATH as done in the PyInstaller docs.

Since I don't have a machine where I can repro/test this, I'll leave it to someone else.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Probably still an issue.

Same here on Ubuntu 19.10 with v0.8.4 (installed it from the .zip file)

Curiously, if my only installed browser is Firefox, then clicking on "open dashboard" (applies to the other entries as well) in the tray does nothing, but when I additionally install the Brave Browser, then the dashboard does open in the Brave Browser, but not in Firefox when I change it to the default browser.

This is still an issue on Fedora 32 with KDE Plasma with Firefox as a default browser

Same issue with activitywatch-v0.9.2 on Ubuntu 20.04 LTS KDE, google-chrome as default browser

Someone who has this issue, could you try this out if it works?
https://github.com/ActivityWatch/aw-qt/pull/59#issuecomment-649280546

It is now merged, will be fixed in the next version of ActivityWatch or if you build yourself from master.

If it doesn't work for someone, please add a comment and I'll reopen this issue.

Same issue with activitywatch-v0.9.2 on Arch Linux (Kernel 5.7.10) KDE 5.19.3, Firefox as default browser, installing it from AUR package activitywatch-bin.
Should I install the -git edition ?

@whriedplanck The -git AUR package is news to us, and not officially supported, but if the package works it should fix the issue since it avoids the use of PyInstaller.

However, we recommend waiting for the next release and until then open http://localhost:5600 manually.

Yes, the |-git| package was pushed by a Arch Linux user I know. But it is a little difficult to install because it will build from source (which takes a long time to git clone and build) …… I will open |http://localhost:5600| manually and see how about the next release. : )
Best wishes!

@whriedplanck https://github.com/whriedplanck The |-git| AUR package
is news to us, and not officially supported, but if the package works
it should fix the issue since it avoids using PyInstaller.

However, we recommend waiting for the next release and until then open
|http://localhost:5600| manually.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ActivityWatch/activitywatch/issues/208#issuecomment-664321656,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALLK3JDKI46U6D4G3VU7KJDR5VMMLANCNFSM4FG6MHXQ.

I have same issue as I thought it's related to that issue.

I tried:

$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/qt5
$ ./aw-qt
# Or:
$ LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/qt5 ./aw-qt

# And also for this path:

$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
$ ./aw-qt
# Or:
$ LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ ./aw-qt

Info:

$ qtchooser  -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/qt5/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"

@omidraha Unfortunately changing the LD_LIBRARY_PATH will have no effect because the executable will override it (as stated in this comment above https://github.com/ActivityWatch/activitywatch/issues/208#issuecomment-417346407).

The only way to fix it would be to wait for a new release or build the git version from source u fortunately. We will try to make a new release soon! Until then you can access the UI by going to http://localhost:5600

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamsoorena picture iamsoorena  Â·  10Comments

austil picture austil  Â·  3Comments

alexriabtsev picture alexriabtsev  Â·  4Comments

xylix picture xylix  Â·  6Comments

ErikBjare picture ErikBjare  Â·  10Comments