ActivityWatch / activitywatch

The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.
https://activitywatch.net/
Mozilla Public License 2.0
12.69k stars 565 forks source link

Opening the dashboard crashes aw-qt #132

Closed nikanar closed 4 years ago

nikanar commented 7 years ago

I don't have a trace yet (I tend to close the console in which I launch aw-qt and I don't know where to find logs), but it already happened twice (/2), to me today that clicking "Open Dashboard" would make aw-qt crash, with only the aw-server process staying alive (nothing unexpected here).

Is there a known issue about this ?

More details to come.

(Edit : Arch Linux)

johan-bjareholt commented 7 years ago

Hm, that's odd. I have had issues on some linux distros that the link doesn't open so i have to go to localhost:5600 manually, but it has never crashed. What OS are you using?

Edit: by the way, logs can be found at ~/.cache/activitywatch/log/ on linux as described in https://github.com/ActivityWatch/activitywatch/blob/master/CONTRIBUTING.md

nikanar commented 7 years ago

Ah, thanks, I forgot that. Arch linux.

Nothing noticeable in those logs. ``` $ cat ~/.cache/activitywatch/log/*/* | grep 23:50 [there's nothing here at 23:50:31] 2017-11-10 23:50:56,912 [INFO ]: Starting module aw-server (aw_qt.manager:44) 2017-11-10 23:50:57,916 [INFO ]: Starting module aw-watcher-afk (aw_qt.manager:44) 2017-11-10 23:50:57,922 [INFO ]: Starting module aw-watcher-window (aw_qt.manager:44) 2017-11-10 23:50:57,927 [INFO ]: Creating trayicon... (aw_qt.trayicon:145) {"asctime": "2017-11-10 23:50:57,519", "filename": "main.py", "funcName": "main", "levelname": "INFO", "lineno": 25, "module": "main", "message": "Using storage method: peewee", "name": "aw_server.main", "pathname": "/home/will/.local/lib/python3.6/site-packages/aw_server/main.py"} {"asctime": "2017-11-10 23:50:57,520", "filename": "main.py", "funcName": "main", "levelname": "INFO", "lineno": 30, "module": "main", "message": "Starting up...", "name": "aw_server.main", "pathname": "/home/will/.local/lib/python3.6/site-packages/aw_server/main.py"} {"asctime": "2017-11-10 23:50:57,520", "filename": "peewee.py", "funcName": "__init__", "levelname": "INFO", "lineno": 111, "module": "peewee", "message": "Using database file: /home/will/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db", "name": "aw_datastore.storages.peewee", "pathname": "/home/will/.local/lib/python3.6/site-packages/aw_core-0.4.0-py3.6.egg/aw_datastore/storages/peewee.py"} {"asctime": "2017-11-10 23:50:57,525", "filename": "_internal.py", "funcName": "_log", "levelname": "INFO", "lineno": 87, "module": "_internal", "message": " * Running on http://localhost:5600/ (Press CTRL+C to quit)", "name": "werkzeug", "pathname": "/usr/lib/python3.6/site-packages/werkzeug/_internal.py"} 2017-11-10 23:50:31,108 [INFO ]: afkwatcher stopped because parent process died (aw_watcher_afk.afk:76) 2017-11-10 23:50:58,399 [INFO ]: afkwatcher started (aw_watcher_afk.afk:59) 2017-11-10 23:50:58,446 [INFO ]: Connection to aw-server established (aw_client.client:257) 2017-11-10 23:50:31,153 [INFO ]: window-watcher stopped because parent process died (aw_watcher_window.main:62) 2017-11-10 23:50:58,342 [INFO ]: Running watcher with poll time 1.0 seconds (aw_watcher_window.main:35) 2017-11-10 23:50:58,343 [INFO ]: aw-watcher-window has started (aw_watcher_window.main:44) 2017-11-10 23:50:58,401 [INFO ]: Connection to aw-server established (aw_client.client:257) ```
ErikBjare commented 7 years ago

aw-qt can be difficult to debug since some types of crashes don't leave error messages in the log (sigsegv in something Qt related for example, possibly caused by bugs PyInstaller).

Could you run aw-qt from a terminal and check the output of the aw-qt command when it crashes? There might be something in stdout/stderr that isn't in the logs. Try --verbose as well if that's implemented for aw-qt.

On Nov 11, 2017 22:56, "Nikana" notifications@github.com wrote:

Ah, thanks, I forgot that. Arch linux. Nothing noticeable in those logs.

$ cat ~/.cache/activitywatch/log// | grep 23:50 [there's nothing here at 23:50:31] 2017-11-10 23:50:56,912 [INFO ]: Starting module aw-server (aw_qt.manager:44) 2017-11-10 23:50:57,916 [INFO ]: Starting module aw-watcher-afk (aw_qt.manager:44) 2017-11-10 23:50:57,922 [INFO ]: Starting module aw-watcher-window (aw_qt.manager:44) 2017-11-10 23:50:57,927 [INFO ]: Creating trayicon... (aw_qt.trayicon:145)

{"asctime": "2017-11-10 23:50:57,519", "filename": "main.py", "funcName": "main", "levelname": "INFO", "lineno": 25, "module": "main", "message": "Using storage method: peewee", "name": "aw_server.main", "pathname": "/home/will/.local/lib/python3.6/site-packages/aw_server/main.py"} {"asctime": "2017-11-10 23:50:57,520", "filename": "main.py", "funcName": "main", "levelname": "INFO", "lineno": 30, "module": "main", "message": "Starting up...", "name": "aw_server.main", "pathname": "/home/will/.local/lib/python3.6/site-packages/aw_server/main.py"} {"asctime": "2017-11-10 23:50:57,520", "filename": "peewee.py", "funcName": "init", "levelname": "INFO", "lineno": 111, "module": "peewee", "message": "Using database file: /home/will/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db", "name": "aw_datastore.storages.peewee", "pathname": "/home/will/.local/lib/python3.6/site-packages/aw_core-0.4.0-py3.6.egg/aw_datastore/storages/peewee.py"} {"asctime": "2017-11-10 23:50:57,525", "filename": "_internal.py", "funcName": "_log", "levelname": "INFO", "lineno": 87, "module": "_internal", "message": " * Running on http://localhost:5600/ (Press CTRL+C to quit)", "name": "werkzeug", "pathname": "/usr/lib/python3.6/site-packages/werkzeug/_internal.py"}

2017-11-10 23:50:31,108 [INFO ]: afkwatcher stopped because parent process died (aw_watcher_afk.afk:76) 2017-11-10 23:50:58,399 [INFO ]: afkwatcher started (aw_watcher_afk.afk:59) 2017-11-10 23:50:58,446 [INFO ]: Connection to aw-server established (aw_client.client:257)

2017-11-10 23:50:31,153 [INFO ]: window-watcher stopped because parent process died (aw_watcher_window.main:62) 2017-11-10 23:50:58,342 [INFO ]: Running watcher with poll time 1.0 seconds (aw_watcher_window.main:35) 2017-11-10 23:50:58,343 [INFO ]: aw-watcher-window has started (aw_watcher_window.main:44) 2017-11-10 23:50:58,401 [INFO ]: Connection to aw-server established (aw_client.client:257)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ActivityWatch/activitywatch/issues/132#issuecomment-343696842, or mute the thread https://github.com/notifications/unsubscribe-auth/ABVxut6zgM3lxNdG4M7CxuEdFNJBGCTcks5s1hgjgaJpZM4QaXpX .

nikanar commented 7 years ago

I can't seem to reproduce it for now. Sorry for the noise.

nikanar commented 7 years ago

It happened again, and/but terminal was closed.

In fact, I restarted AW and it worked well (it opened the dashboard) while the terminal was open, and then I close the terminal (process being in the background), and then it crashed again (when I clicked "Open Dashboard").

So just like in https://github.com/ActivityWatch/aw-watcher-window/issues/27 : I can't get a terminal trace because the crash only happens when the terminal is closed.

It sounds like a really obscure reason, but the behavior is very well identified & stable & reproducible now on my machine.

johan-bjareholt commented 7 years ago

In your autostart of aw-qt, do something like aw-qt 2>&1 ~/.aw-qt-stdout.log so you can get the stack trace next time it crashes. We have plans to add so all stdout/stderr is redirected to the logs aswell later but that is not finished yet.

nikanar commented 7 years ago

Good idea and it doesn't crash that way (aw-qt >~/.aw-qt-stdout.log 2>&1 or aw-qt |& tee .awqt.log to also keep the terminal messages), even with the terminal closed. Still crashes as clockwork if I don't redirect the output though.

This question seems to describe the issue, and this one also.

I suggest to first focus on https://github.com/ActivityWatch/aw-watcher-window/issues/27 because it's almost certainly the very same problem and that one is easier.

stale[bot] commented 4 years ago

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.

stale[bot] commented 4 years ago

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.