Hi there!
First off, my experience with using terminal has only been with following instructions, and i experienced an issue using ActivityWatch, so now i麓m stuck... I麓m trying to move to all things open sourced and i have enjoyed using ActivityWatch so i hope somebody can help me with this. The solution to the problem may seem obvious, but i would really appreciate the help! thank you!
ActivityWatch release: activitywatch-v0.8.0b7-macos-x86_64.zip
Operating system: MacOS Mojave 10.14.2
One day i got the a pop-up saying "Module aw-server quit unexpectedly" when i click restart it just shows up again.
If i try to "open dashboard" or "open API browser" i get this message:
"This site can鈥檛 be reached localhost refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall"
When i open terminal, this is newest chunk of info after having restarted:
"During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "__main__.py", line 3, in
File "aw_server/main.py", line 33, in main
File "aw_server/server.py", line 70, in _start
File "aw_datastore/datastore.py", line 17, in __init__
File "aw_datastore/storages/peewee.py", line 119, in __init__
File "peewee.py", line 5024, in table_exists
File "peewee.py", line 4074, in get_tables
File "peewee.py", line 3837, in execute_sql
File "peewee.py", line 3656, in __exit__
File "peewee.py", line 135, in reraise
File "peewee.py", line 3830, in execute_sql
peewee.DatabaseError: database disk image is malformed
[97483] Failed to execute script __main__
2019-02-11 01:32:31 [WARNING]: Tried to stop module aw-server, but it wasn't running (aw_qt.manager:81)"
In addition to lots of these:
"2019-02-11 01:32:38 [WARNING]: Not connected to server, 6182 requests in queue (aw_client.client:376)
2019-02-11 01:32:38 [WARNING]: Not connected to server, 5981 requests in queue (aw_client.client:376)
2019-02-11 01:32:48 [WARNING]: Not connected to server, 6183 requests in queue (aw_client.client:376)
2019-02-11 01:32:48 [WARNING]: Not connected to server, 5982 requests in queue (aw_client.client:376)
2019-02-11 01:32:58 [WARNING]: Not connected to server, 6184 requests in queue (aw_client.client:376)
2019-02-11 01:32:58 [WARNING]: Not connected to server, 5982 requests in queue"
Please help...
2019-02-11 01:32:38 [WARNING]: Not connected to server, 6182 requests in queue (aw_client.client:376)
2019-02-11 01:32:38 [WARNING]: Not connected to server, 5981 requests in queue (aw_client.client:376)
2019-02-11 01:32:48 [WARNING]: Not connected to server, 6183 requests in queue (aw_client.client:376)
2019-02-11 01:32:48 [WARNING]: Not connected to server, 5982 requests in queue (aw_client.client:376)
2019-02-11 01:32:58 [WARNING]: Not connected to server, 6184 requests in queue (aw_client.client:376)
2019-02-11 01:32:58 [WARNING]: Not connected to server, 5982 requests in queue
This just means that your watchers in the background fail to send its records to aw-server (since it's not starting). It creates a queue of all requests and will send them once the server is running again (to work through such a large queue might take a few hours though as this is unoptimized currently).
peewee.DatabaseError: database disk image is malformed
This one is more troublesome and comes from aw-server itself. It means that the aw-server database has somehow gotten corrupted and cannot be read. If you have a backup you can replace the old one without any issues, but if not the straight forward thing to do is to simply delete it. It might be possible to recover it though, I have never tried to but if you google "recover corrupt sqlite database" you might get some results.
The database file on macOS should be located at Library/Application Support/activitywatch/aw-server/peewee-sqlite.v2.db I believe.
Also, did something specific happen to your computer when activitywatch stopped working? Did your computer suddenly shut off (most likely), did activitywatch crash, did something else happen? This is the first case this has happened to someone and since it's a pretty serious issue to lose all your data we'd love to know in case we can do something to prevent it in the future.
Thank you so much!
I chose to delete the database because i haven麓t really gotten into what i intended to use it for.
As you saw with the large queue it took a while before i reached out, so unfortunately i can麓t remember what exactly happened to cause this but i think your right on point with the suggestion of my computer shutting off for some reason. Here are some possible causes (so that this hopefully can be fixed in the future as you said):
Note: i can麓t remember the last time i actually turned my computer "off", i just close it.
a) "Crash" From time to time all my windows and apps have been closed when i open the computer, where i get the message "something unexpected happened, do you want to retrieve your previous tabs?" in the browser
b) MacOS software update. I have set it to automatically update, so a possibility. But considering my problem maybe being the first of it麓s kind, maybe not.
c) Unresponsive computer. I can麓t remember if i was using ActivityWatch when this happened, but it may have been. I had put the pc aside for maybe an hour or so (with screen up, still running) while being charged, and when i was going to use it again, the fan was running very loudly, the screen was black and unresponsive with keyboard still lit. I just had to hold down the on/off button and then i was back to normal. Even though i probably had to reopen every app etc i had been using previously.
Hope this can be to some help, and again, thank you!
Great that it worked!
a) This one sounds a bit worry some, this could be a cause.
b) If the computer shuts down because of a software update it usually quits the program somewhat gracefully and shouldn't corrupt the database, I was more wondering if the laptop suddenly lost power completely (so the harddrive is working on a write but didn't have enough time to finish writing).
c) Holding down the power button could be the cause, but in that case you didn't really have an option.
Sounds like these are examples of where we really can't do much to increase the reliability of ActivityWatch except for trying to lower the amount of writes to the harddrive so it gets less likely.
We have a change upcoming which should improve this a bit though!
for anyone finding this through search, there's good chance you might be able to recover image.
i was able to recover it with https://github.com/sqlitebrowser/sqlitebrowser
importing damaged database and exporting it as sql worked on other databases, but for some reason didn't work this time. i had to export it to csv instead, create empty db and import csv files
Most helpful comment
This just means that your watchers in the background fail to send its records to aw-server (since it's not starting). It creates a queue of all requests and will send them once the server is running again (to work through such a large queue might take a few hours though as this is unoptimized currently).
This one is more troublesome and comes from aw-server itself. It means that the aw-server database has somehow gotten corrupted and cannot be read. If you have a backup you can replace the old one without any issues, but if not the straight forward thing to do is to simply delete it. It might be possible to recover it though, I have never tried to but if you google "recover corrupt sqlite database" you might get some results.
The database file on macOS should be located at Library/Application Support/activitywatch/aw-server/peewee-sqlite.v2.db I believe.
Also, did something specific happen to your computer when activitywatch stopped working? Did your computer suddenly shut off (most likely), did activitywatch crash, did something else happen? This is the first case this has happened to someone and since it's a pretty serious issue to lose all your data we'd love to know in case we can do something to prevent it in the future.