ActivityWatch was working well for me to track my time spent for work for a few days, but I just looked today after not checking it for a while and it’s giving me an “Internal server error” when I try to view the activity page from March 1st until today. I can see that it was tracking my windows when I look at the timeline, though…the activity page view is just so much more helpful to enter my time for each project in my time sheet. When I look at the server logs, it looks like sometime a few days ago (March 12) I started getting this error:
2024-03-12 11:06:14 [ERROR]: Exception on /api/0/query/ [POST] (aw-server:1449)
I have no idea what that means or why it started happening. I didn’t change any settings in AW that I can think of. Looking at my browser history I was clicking around in outlook for web and other chrome tabs (but nothing to do with AW) when this initially happened. I have not changed anything in my regex since it was initially working properly.
I appreciate any help! I’m pretty clueless about this but it seemed like I had it figured out and functional , and now it’s…not.
Here’s the log text. Thank you!!
2024-03-12 11:01:57 [INFO ]: Received heartbeat after pulse window, inserting as new event. (bucket: aw-watcher-window_Ks-Air) (aw_server.api:279)
2024-03-12 11:06:14 [WARNING]: Gap was of negative duration but could be safely merged (-2.535s). This message will only show once per batch. (aw_transform.flood:46)
2024-03-12 11:06:14 [WARNING]: Gap was of negative duration and could NOT be safely merged (-0.189s). This warning will only show once per batch. (aw_transform.flood:54)
2024-03-12 11:06:14 [ERROR]: Exception on /api/0/query/ [POST] (aw-server:1449)
Traceback (most recent call last):
File “flask/app.py”, line 1517, in full_dispatch_request
File “flask/app.py”, line 1503, in dispatch_request
File “aw_server/rest.py”, line 46, in decorator
File “flask_restx/api.py”, line 405, in wrapper
File “flask/views.py”, line 84, in view
File “flask_restx/resource.py”, line 46, in dispatch_request
File “aw_server/rest.py”, line 323, in post
File “aw_server/api.py”, line 310, in query2
File “aw_query/query2.py”, line 417, in query
File “aw_query/query2.py”, line 391, in interpret
File “aw_query/query2.py”, line 140, in interpret
File “aw_query/functions.py”, line 88, in g
File “aw_query/functions.py”, line 117, in g
File “aw_query/functions.py”, line 198, in q2_filter_keyvals_regex
File “aw_transform/filter_keyvals.py”, line 28, in filter_keyvals_regex
File “aw_transform/filter_keyvals.py”, line 28, in
File “aw_transform/filter_keyvals.py”, line 26, in predicate
KeyError: ‘title’
2024-03-12 11:06:14 [INFO ]: 500 (127.0.0.1): e[35me[1mPOST /api/0/query/ HTTP/1.1e[0m (flask:25)
2024-03-12 11:48:47 [INFO ]: Received heartbeat after pulse window, inserting as new event. (bucket: aw-watcher-window_Ks-Air) (aw_server.api:279)
(then it repeats that “…inserting new event” line for some time before more errors)
2024-03-13 18:35:53 [ERROR]: Exception on /api/0/buckets/aw-watcher-window_Ks-Air/heartbeat [POST] (aw-server:1449)
Traceback (most recent call last):
File “peewee.py”, line 3237, in execute_sql
sqlite3.OperationalError: database is locked
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “flask/app.py”, line 1517, in full_dispatch_request
File “flask/app.py”, line 1503, in dispatch_request
File “aw_server/rest.py”, line 46, in decorator
File “flask_restx/api.py”, line 405, in wrapper
File “flask/views.py”, line 84, in view
File “flask_restx/resource.py”, line 46, in dispatch_request
File “aw_server/rest.py”, line 303, in post
File “aw_server/api.py”, line 43, in g
File “aw_server/api.py”, line 276, in heartbeat
File “aw_datastore/datastore.py”, line 177, in replace_last
File “aw_datastore/storages/peewee.py”, line 239, in replace_last
File “peewee.py”, line 6740, in save
File “peewee.py”, line 1962, in inner
File “peewee.py”, line 2033, in execute
File “peewee.py”, line 2551, in _execute
File “peewee.py”, line 3250, in execute
File “peewee.py”, line 3244, in execute_sql
File “peewee.py”, line 3010, in exit
File “peewee.py”, line 192, in reraise
File “peewee.py”, line 3237, in execute_sql
peewee.OperationalError: database is locked
2024-03-13 18:35:53 [INFO ]: 500 (127.0.0.1): e[35me[1mPOST /api/0/buckets/aw-watcher-window_Ks-Air/heartbeat?pulsetime=16.33503806591034 HTTP/1.1e[0m (flask:25)
2024-03-13 18:35:56 [INFO ]: Received heartbeat after pulse window, inserting as new event. (bucket: aw-watcher-window_Ks-Air) (aw_server.api:279)
2024-03-13 18:40:39 [ERROR]: Exception on /api/0/buckets/aw-watcher-window_Ks-Air/heartbeat [POST] (aw-server:1449)
Traceback (most recent call last):
File “peewee.py”, line 3237, in execute_sql
sqlite3.OperationalError: database is locked
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “flask/app.py”, line 1517, in full_dispatch_request
File “flask/app.py”, line 1503, in dispatch_request
File “aw_server/rest.py”, line 46, in decorator
File “flask_restx/api.py”, line 405, in wrapper
File “flask/views.py”, line 84, in view
File “flask_restx/resource.py”, line 46, in dispatch_request
File “aw_server/rest.py”, line 303, in post
File “aw_server/api.py”, line 43, in g
File “aw_server/api.py”, line 276, in heartbeat
File “aw_datastore/datastore.py”, line 177, in replace_last
File “aw_datastore/storages/peewee.py”, line 239, in replace_last
File “peewee.py”, line 6740, in save
File “peewee.py”, line 1962, in inner
File “peewee.py”, line 2033, in execute
File “peewee.py”, line 2551, in _execute
File “peewee.py”, line 3250, in execute
File “peewee.py”, line 3244, in execute_sql
File “peewee.py”, line 3010, in exit
File “peewee.py”, line 192, in reraise
File “peewee.py”, line 3237, in execute_sql
peewee.OperationalError: database is locked
2024-03-13 18:40:39 [ERROR]: Exception on /api/0/buckets/aw-watcher-window_Ks-Air/heartbeat [POST] (aw-server:1449)
Traceback (most recent call last):
File “peewee.py”, line 3237, in execute_sql
sqlite3.OperationalError: database is locked
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “flask/app.py”, line 1517, in full_dispatch_request
File “flask/app.py”, line 1503, in dispatch_request
File “aw_server/rest.py”, line 46, in decorator
File “flask_restx/api.py”, line 405, in wrapper
File “flask/views.py”, line 84, in view
File “flask_restx/resource.py”, line 46, in dispatch_request
File “aw_server/rest.py”, line 303, in post
File “aw_server/api.py”, line 43, in g
File “aw_server/api.py”, line 276, in heartbeat
File “aw_datastore/datastore.py”, line 177, in replace_last
File “aw_datastore/storages/peewee.py”, line 239, in replace_last
File “peewee.py”, line 6740, in save
File “peewee.py”, line 1962, in inner
File “peewee.py”, line 2033, in execute
File “peewee.py”, line 2551, in _execute
File “peewee.py”, line 3250, in execute
File “peewee.py”, line 3244, in execute_sql
File “peewee.py”, line 3010, in exit
File “peewee.py”, line 192, in reraise
File “peewee.py”, line 3237, in execute_sql
peewee.OperationalError: database is locked
2024-03-13 18:40:39 [INFO ]: 500 (127.0.0.1): e[35me[1mPOST /api/0/buckets/aw-watcher-window_Ks-Air/heartbeat?pulsetime=1.0 HTTP/1.1e[0m (flask:25)
2024-03-13 18:40:39 [INFO ]: Received heartbeat after pulse window, inserting as new event. (bucket: aw-watcher-window_Ks-Air) (aw_server.api:279)
After this point it seems like it repeats the database is locked errors