activitywatch icon indicating copy to clipboard operation
activitywatch copied to clipboard

Linux: `[Errno 5] Input/output error (aw_server.server:122)` when starting-up `aw-qt`

Open kuanyui opened this issue 3 years ago • 4 comments

  • [x] I am on the latest ActivityWatch version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • OS name and version: Manjaro (latest, rolling upgrading)
  • ActivityWatch version: 0.12.1

Describe the bug

I install activitywatch-bin (0.12.1-1) from AUR on Manjaro, and when execute aw-qt, it shows error immediately and interrupted, totally unusable:

Screenshot_20221201_202610

Totally donno how to get more imformative logs for debugging so copy-paste the error message in it:

2022-12-01 20:23:26 [INFO ]: Using storage method: peewee  (aw_server.main:33)
2022-12-01 20:23:26 [INFO ]: Starting up...  (aw_server.main:41)
2022-12-01 20:23:26 [INFO ]: Using database file: /home/ky/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db  (aw_datastore.storages.peewee:126)
2022-12-01 20:23:26 [ERROR]: [Errno 5] Input/output error  (aw_server.server:122)
Traceback (most recent call last):
  File "aw_server/server.py", line 113, in _start
  File "flask/app.py", line 909, in run
  File "flask/cli.py", line 649, in show_server_banner
  File "click/utils.py", line 300, in echo
OSError: [Errno 5] Input/output error
2022-12-01 20:23:26 [ERROR]: Unhandled exception  (root:51)
Traceback (most recent call last):
  File "__main__.py", line 3, in <module>
  File "aw_server/main.py", line 42, in main
  File "aw_server/server.py", line 123, in _start
  File "aw_server/server.py", line 113, in _start
  File "flask/app.py", line 909, in run
  File "flask/cli.py", line 649, in show_server_banner
  File "click/utils.py", line 300, in echo
OSError: [Errno 5] Input/output error
2022-12-01 20:23:26 [ERROR]: Unhandled exception  (root:51)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 5] Input/output error
2022-12-01 20:23:26 [ERROR]: Unhandled exception  (root:51)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
OSError: [Errno 5] Input/output error

To Reproduce

  1. Install activitywatch-bin on AUR provided by ActivityWatch officially.
  2. Run aw-qt

Expected behavior

No error.

Documentation

Above mentioned.

Additional context

  • python 3.10.8

kuanyui avatar Dec 02 '22 02:12 kuanyui

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! 🙏

github-actions[bot] avatar Dec 02 '22 02:12 github-actions[bot]

  File "click/utils.py", line 300, in echo

Reference: https://github.com/pallets/click/blob/bf9da4838986af3bc09a1b16974d154c61dcbe3f/src/click/utils.py#L300

Sorry I've not written Python for 5 years... I guess it may due to a failed sys.stdout.flush() or so.

Running aw-server in terminal directly is workable. So I guess it may be the problem in PyQt/Python's subprocess stdout environment.

kuanyui avatar Dec 02 '22 04:12 kuanyui

I found where the problem is. I found that if run aw-qt in a terminal, server & gui has no error. Therefore:

  • The reason is indeed stdout.
  • I always launch application via krunner (KDE's application launcher), but it seems do some trick to the stdout of the application launched by it.
    • So run aw-qt in krunner will cause server error. Screenshot_20221202_183850
    • But run aw-qt > /dev/null in krunner, the server startups correctly. Screenshot_20221202_183858

I guess this is a bug that should be fixed, but I don't sure if this should be fixed in packager of Linux distro, or ActivityWatch itself.

kuanyui avatar Dec 02 '22 10:12 kuanyui

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] avatar Jul 19 '25 10:07 stale[bot]