Activitywatch: aw-qt not starting : got an ImportError out of nowhere!

Created on 8 Jan 2018  路  10Comments  路  Source: ActivityWatch/activitywatch

I was happily living my life using activity watch. yesterday I found out that activity watch is not running so I checked my startup applications and copied the code that I'd added there long time ago to see the problem:
as I pasted this to terminal:
/usr/bin/activitywatch/activitywatch/aw-qt
this error showed up:

Traceback (most recent call last):
  File "aw_qt/__main__.py", line 1, in <module>
  File "/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
  File "aw_qt/__init__.py", line 3, in <module>
  File "/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
  File "aw_qt/main.py", line 9, in <module>
  File "/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
  File "aw_qt/trayicon.py", line 9, in <module>
  File "/home/travis/virtualenv/python3.5.3/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 714, in load_module
ImportError: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: undefined symbol: drmGetDevices2
[24271] Failed to execute script __main__

and since then I have not been able to work things around, and I just loosed all of my logs.
please help. :D


os : ubuntu 16.04

linux high pyinstaller bug

Most helpful comment

Found some other projects having a very similar issue and setup:

Apparently, a workaround is to remove or rename libdrm.so.2 from the folder where the executable is located. Since libdrm should be available on all systems anyway we might want to remove them from the builds entirely.

All 10 comments

Seems like an odd crash indeed.

ImportError: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: undefined symbol: drmGetDevices2

Seems like some library fails to load?
Hard to tell exactly what's the issue, but a couple of guesses:

  • Could be that you upgraded your graphics driver without restarting?
  • Somehow some .so file has disappeared from your activitywatch executable folder? (redownload and copy over again, your data is saved elsewhere (in your home directory) so it will not dissapear)

When googling that ImportError line I get lots of results which are also related to Python and PyInstaller, maybe looking at those could helpwith understanding what's broken aswell?

In the meantime, you can try running aw-server, aw-watcher-afk, and aw-watcher-window manually (they are located in the same folder as aw-qt). Hopefully they don't need the libGL library causing the problem.

No longer an isolated incident: https://twitter.com/daarkecloud/status/951089936601681920

Bumping priority.

Found this interesting discussion: https://bugs.freedesktop.org/show_bug.cgi?id=101564

Ubuntu published an updated libdrm for 16.04 on the third on January, probably related: https://launchpad.net/ubuntu/+source/libdrm/2.4.83-1~16.04.1

Found some other projects having a very similar issue and setup:

Apparently, a workaround is to remove or rename libdrm.so.2 from the folder where the executable is located. Since libdrm should be available on all systems anyway we might want to remove them from the builds entirely.

I just removed libdrm.so.2 and when I run this : /usr/bin/activitywatch/activitywatch/aw-qt
I get this error:
image
which contains these JSONs:

{"asctime": "2018-02-02 19:26:18,914", "filename": "main.py", "funcName": "main", "levelname": "INFO", "lineno": 25, "module": "main", "message": "Using storage method: peewee", "name": "aw_server.main", "pathname": "aw_server/main.py"}
{"asctime": "2018-02-02 19:26:18,915", "filename": "main.py", "funcName": "main", "levelname": "INFO", "lineno": 30, "module": "main", "message": "Starting up...", "name": "aw_server.main", "pathname": "aw_server/main.py"}
{"asctime": "2018-02-02 19:26:18,915", "filename": "peewee.py", "funcName": "__init__", "levelname": "INFO", "lineno": 111, "module": "peewee", "message": "Using database file: /home/soorena/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db", "name": "aw_datastore.storages.peewee", "pathname": "site-packages/aw_datastore/storages/peewee.py"}

My best guess is that the previous instance of aw-server is still running. If you can still access the web UI, that is definitely the case.

Kill the process manually (using the terminal or a process manager) and try again.

Sorry for the problems, and thanks for helping us learn about these issues :)

@ErikBjare I'm happy to help.
you were right it was already running and now I have no problem. thanks for your help.
for those who came here for a workaround this works.

Alright, so what we should do in order to close this issue is:

  • [x] Remove libdrm.so.2 from the build in CI (maybe other common libraries as well?)
  • [x] Give "Address already in use" a proper error message
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Chuhtra picture Chuhtra  路  7Comments

ErikBjare picture ErikBjare  路  4Comments

ErikBjare picture ErikBjare  路  6Comments

xylix picture xylix  路  6Comments

ErikBjare picture ErikBjare  路  4Comments