aw-watcher-windows: Broken pipe
Closed this issue · 6 comments
- I am on the latest ActivityWatch version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- OS name and version: Fedora 36
- ActivityWatch version: 0.11.0
Describe the bug
aw-watcher-windows crashed and stopped reporting metrics.
To Reproduce
Have not tried reproducing it yet.
Expected behavior
Ideally, aw-watcher-windows should restart. Maybe have a systemd unit config or similar.
Documentation
aw-watcher-window logs:
2022-07-06 15:34:20 [INFO ]: aw-watcher-window started (aw_watcher_window.main:51)
2022-07-06 15:34:21 [INFO ]: Connection to aw-server established by aw-watcher-window (aw_client.client:417)
2022-07-06 15:45:34 [ERROR]: Exception thrown while trying to get active window: Display connection closed by server: [Errno 32] Broken pipe (aw_watcher_window.main:74)
2022-07-06 15:45:34 [ERROR]: Unhandled exception (root:43)
Traceback (most recent call last):
File "Xlib/protocol/display.py", line 583, in send_and_recv
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aw_watcher_window/main.py", line 71, in heartbeat_loop
File "aw_watcher_window/lib.py", line 53, in get_current_window
File "aw_watcher_window/lib.py", line 8, in get_current_window_linux
File "aw_watcher_window/xlib.py", line 37, in get_current_window
File "aw_watcher_window/xlib.py", line 20, in _get_current_window_id
File "Xlib/xobject/drawable.py", line 472, in get_full_property
File "Xlib/xobject/drawable.py", line 455, in get_property
File "Xlib/protocol/rq.py", line 1369, in __init__
File "Xlib/protocol/rq.py", line 1381, in reply
File "Xlib/protocol/display.py", line 586, in send_and_recv
Xlib.error.ConnectionClosedError: Display connection closed by server: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "aw_watcher_window/__main__.py", line 3, in <module>
File "aw_watcher_window/main.py", line 55, in main
File "aw_watcher_window/main.py", line 77, in heartbeat_loop
File "traceback.py", line 163, in print_exc
File "traceback.py", line 105, in print_exception
OSError: [Errno 5] Input/output error
2022-07-06 15:45:34 [ERROR]: Unhandled exception (root:43)
Traceback (most recent call last):
File "<string>", line 1, in <module>
OSError: [Errno 5] Input/output error
Hi there!
As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct.
Thanks a bunch for opening your first issue! 🙏
Will add information if I'm able to reproduce it.
This is probably (indirectly) caused by ActivityWatch/aw-qt#49
@wuyudi Holy moly. Sorry about that.
PRs welcome! (I'm afraid I'll keep procrastinating on this otherwise)
The following PRs should make sure this never happens again:
- Rotating logfiles with max size: ActivityWatch/aw-core#114
- Handle the errors better: ActivityWatch/aw-watcher-window#73
Thanks for reporting @ivanpondal & @wuyudi!