Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iamsoorena opened this issue Jan 8, 2018 · 10 comments
Closed

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

iamsoorena opened this issue Jan 8, 2018 · 10 comments

Comments

@iamsoorena
Copy link

iamsoorena commented Jan 8, 2018

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

@johan-bjareholt
Copy link
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?

@ErikBjare
Copy link
Member

ErikBjare commented Jan 8, 2018

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.

@ErikBjare
Copy link
Member

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

Bumping priority.

@ErikBjare
Copy link
Member

ErikBjare commented Jan 11, 2018

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

@ErikBjare
Copy link
Member

ErikBjare commented Jan 26, 2018

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.

@iamsoorena
Copy link
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"}

@ErikBjare
Copy link
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 :)

@iamsoorena
Copy link
Author

iamsoorena commented Feb 3, 2018

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

@ErikBjare
Copy link
Member

ErikBjare commented Feb 12, 2018

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

@ErikBjare
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants