Skip to content

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

Description

@iamsoorena

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

Activity

  1. johan-bjareholt commented on Jan 8, 2018

    @johan-bjareholt
    Member

    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?

  2. ErikBjare commented on Jan 8, 2018

    @ErikBjare
    Member

    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.

  3. ErikBjare commented on Jan 10, 2018

    @ErikBjare
    Member

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

    Bumping priority.

  4. ErikBjare commented on Jan 11, 2018

    @ErikBjare
    Member

    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

  5. ErikBjare commented on Jan 26, 2018

    @ErikBjare
    Member

    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.

  6. iamsoorena commented on Feb 2, 2018

    @iamsoorena
    Author

    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"}
    
  7. ErikBjare commented on Feb 2, 2018

    @ErikBjare
    Member

    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 :)

  8. iamsoorena commented on Feb 3, 2018

    @iamsoorena
    Author

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

  9. added this to the v0.8 milestone on Feb 12, 2018
  10. ErikBjare commented on Feb 12, 2018

    @ErikBjare
    Member

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

    • Remove libdrm.so.2 from the build in CI (maybe other common libraries as well?)
    • Give "Address already in use" a proper error message
  11. ErikBjare commented on Feb 13, 2018

    @ErikBjare
    Member

    Removed libdrm.so.2 here: 73342d4

    Gave address already in use a proper error message here: ActivityWatch/aw-server@9182eaf

    So we should be done here, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions