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

All modules quit unexpectedly #456

Closed gsabater closed 4 years ago

gsabater commented 4 years ago

Describe the bug

All modules quit unexpectedly upon startup, don't matter if its normal or rust server. Also, details are empty. Clicking on restart does nothing.

This happens on system start and when i try to run the program manually.

Attached screenshot quit

Thanks

johan-bjareholt commented 4 years ago

But if I understand correctly, this is only for the watchers so the servers run without issue?

gsabater commented 4 years ago

No sorry, I worded the issue poorly.

The normal server that runs on startup stops. Also stops when I try to launch it manually.

The rust server don't stops or quits, but the other modules quit as well with the rust server.

None of the scenarios offer any logs when quitting.

Thanks

ErikBjare commented 4 years ago

What happens if you start them individually from the command line? That should at least yield some error message.

The executables should be in activitywatch/aw-server/aw-server.exe, for example.

gsabater commented 4 years ago

I will try to run them from the command line but if you could give me a link or some instructions about how to do it, that would be awesome.

Something like run activitywatch/aw-server/aw-server.exe should be ok?

thanks

ErikBjare commented 4 years ago

Yes, you could do cd <activitywatch directory>/aw-server to first go into the directory and then you should be able to just run aw-server.exe

<activitywatch directory> should be something like C:\Program Files\activitywatch if you used the installer, but I'm not sure.

gsabater commented 4 years ago

Hello,

I tried to browse to the activitywatch installation folder, and I have browsed C:\Program Files (x86)\ActivityWatch and C:\Users\Gaspar\AppData\Local\activitywatch\activitywatch

In any of those directories there any .exe called aw-server.exe or similar Let me attach you two screenshots of those folders.

one two

Looks like the only exe file i can find is the rust server that in fact is the only module that don't crash.

Before opening this issue, I have uninstalled and reinstalled the app several times, and in fact, the issue started after having the program installed a week or so. Also, I don't have any antivirus software or any other programs that could delete those files.

gsabater commented 4 years ago

Update: I have uninstalled and installed again, and looking and the path files, looks like the program installs itself on C:\Users\Gaspar\AppData\Local\Programs\ActivityWatch\aw-server which is different from the two folders I found previously.

Running start aw-server.exe from there has given this output

WARNING:root:Could not import pymongo, not available as a datastore backend
Traceback (most recent call last):
  File "__main__.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\projects\activitywatch\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
  File "aw_server\__init__.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\projects\activitywatch\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
  File "aw_server\main.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "c:\projects\activitywatch\venv\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
  File "aw_server\config.py", line 19, in <module>
  File "aw_core\config.py", line 23, in load_config
  File "configparser.py", line 718, in read_file
  File "configparser.py", line 1080, in _read
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\\Users\\Gaspar\\AppData\\Local\\activitywatch\\activitywatch\\aw-server\\aw-server.ini', line: 1
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
[14468] Failed to execute script __main__

I guess now that this might be related to #349 ? Maybe something was broken when windows updated something?

ErikBjare commented 4 years ago

@gsabater From that output it looks like your configuration file has been corrupted. The warning about MongoDB is irrelevant.

I really have no idea what could have caused that, but you can remove the C:\Users\Gaspar\AppData\Local\activitywatch\activitywatch\aw-server\aw-server.ini file and try again. You might also want to check the health of your hard drive, just to make sure it isn't failing on you.

It's also very weird that you're missing so many of the files in C:\Program Files (x86)\ActivityWatch. I'd really look into that, if I were you.

gsabater commented 4 years ago

Hello,

I see, this might be a malfunction on my hard drive. I will take a look at it for sure.

As a suggestion, it might be a good idea to add a checkbox or something similar on the installation process to remove any configuration files.

Thanks a lot for your time.