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.3k stars 554 forks source link

No data in dashboard even though buckets seem to be filled fine #784

Closed Programmierus closed 2 years ago

Programmierus commented 2 years ago

Firstly, I am sorry if I am missing something quite simple. I really did my best to find a solution on GitHub and in the forums...

Even on v.0.11 suddenly when I switched from FireFox to Chrome (yet again) my AW dashboard stopped reporting domains. It was not that much of an issue since VSCode was reporting fine and this is what is crucial for me. I upgraded to v.0.12 recently and as the problem was not gone, I finally decided to find out what was wrong. My idea was to delete all app data and remove buckets (preserving data was not important). So, I installed v.0.12 from scratch and now:

image

But data is flowing in simply fine:

image

image

What am I missing? It's MacOS Monterey (12.5.1)

github-actions[bot] commented 2 years ago

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

Programmierus commented 2 years ago

Solved. Further researches showed following errors (repeatedly) in aw-watcher-window.log:

2022-09-07 17:20:01 [ERROR]: Exception thrown while trying to get active window  (aw_watcher_window.main:77)
Traceback (most recent call last):
  File "aw_watcher_window/main.py", line 74, in heartbeat_loop
  File "aw_watcher_window/lib.py", line 55, in get_current_window
  File "aw_watcher_window/lib.py", line 27, in get_current_window_macos
  File "aw_watcher_window/macos_jxa.py", line 64, in getInfo
Exception: jxa error: Error: Error: An error occurred.

This relates to #742.

I had to follow #768 though since I was not getting any prompts as described here.

Also Accessibility permissions were required to be reset (dunno why).

ErikBjare commented 2 years ago

I think this occurs when upgrading from a non-codesigned release (like v0.11) where macOS doesn't allow the new version to inherit the previous version's permissions (so you need to manually remove and reset them: https://docs.activitywatch.net/en/latest/updating.html#macos).

As such, you weren't receiving any events from aw-watcher-window (you can see them missing in your timeline & buckets screenshot).

I hope this won't happen for future releases, now that they are codesigned and notarized.

schackbrian2012 commented 1 year ago

I think this occurs when upgrading from a non-codesigned release (like v0.11) where macOS doesn't allow the new version to inherit the previous version's permissions (so you need to manually remove and reset them: https://docs.activitywatch.net/en/latest/updating.html#macos).

@ErikBjare I am experiencing a similar issue to @Programmierus. I tried to follow the instructions in the Updating section of the documentation that you linked to. It says, "When updating on macOS, you may need to remove and readd ActivityWatch to your accessibility permissions," [0]. The Accessibility preference pane in System Preferences contains multiple sections: Overview, VoiceOver, Zoom... Which section should I look under?

[0] https://docs.activitywatch.net/en/latest/updating.html#macos

BelKed commented 1 year ago

You can add and remove permissions for ActivityWatch in the Security & Privacy preference pane under the Privacy tab in the Accessibility "subtab":

Screenshot


If the ActivityWatch app doesn't show up there, you could add it by pressing the + button and then selecting the app file from the menu:

Screenshot 2023-07-07 at 15 43 05

schackbrian2012 commented 1 year ago

@BelKed Thank you for the screenshots. I was looking under System Preferences –> Accessibility, but it is actually under System Preferences –> Security & Privacy –> Privacy –> Accessibility. I added ActivityWatch, and I checked the box. I will wait to see whether data comes into the dashboard.