activitywatch icon indicating copy to clipboard operation
activitywatch copied to clipboard

Issues with Activity having no data, while Timeline and query still does

Open DivineMK opened this issue 1 year ago • 11 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: Arch 6.11.5-arch1-1
  • WM: Hyprland 0.44.1
  • ActivityWatch version: 0.13.1 (rust) (strange as I built from source yesterday)
  • Awatcher version: 0.3.0 (built from source)

Describe the bug

I am having trouble using ActivityWatch on Wayland using awatcher. I have two database, one from another machine, one from this. They share hostname though. However, only the data from the synced buckets (from db of old machine) are displayed in Activity page.

This is from Timeline to show that the data exists. image

And here the Activity page still shows the data from the synced buckets image

However, the ones from the current watchers are not displayed. In addition, the bar chart works the opposite way, showing only the current watchers but not the synced buckets. image

To Reproduce

  1. Create a new database (to replicate I chose to rename the folder of the database)
  2. Run ActivityWatch including aw-sync

Expected behavior

Activity page show data properly like timeline.

Documentation

I am not sure what logs are relevant please let me know so I can provide.

Additional context

This works normally on the first run after when I delete the database of the current machine. But afterwards, it shows no data again.

Remarks

Also the version should be update to 0.13.2 for the servers as well right? I see in the changelog of version 0.13.2 the version of servers are only bumped to 0.13.1.

P.S. I am not sure if this is issue from awatcher or the webui from ActivityWatch so I post the issues on both, sorry for the inconvenience :sweat:

DivineMK avatar Oct 28 '24 14:10 DivineMK

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 Oct 28 '24 15:10 github-actions[bot]

I have been testing it out more and here are the logs I think would be relevant:

aw-sync:

[2024-10-28 15:57:03][INFO][aw_datastore::datastore]: Created bucket aw-watcher-window_linux-hp
[2024-10-28 15:57:03][INFO][aw_sync::sync]:  ⟳  Syncing bucket 'aw-watcher-window_linux-hp'
[2024-10-28 15:57:03][INFO][aw_sync::sync]:    + Starting from beginning
[2024-10-28 15:57:03][INFO][aw_sync::sync]:   = Synced 1819 new events
[2024-10-28 15:57:03][INFO][aw_datastore::worker]: Sending close request to database
[2024-10-28 15:57:03][INFO][aw_sync]: Sync pass done, sleeping for 5 minutes
[2024-10-28 15:57:03][INFO][aw_datastore::worker]: DB Worker thread finished
[2024-10-28 15:58:07][WARN][aw_transform::flood]: Gap was of negative duration and could NOT be safely merged (-PT7.273864157Ss). This warning will only show once per batch.
[2024-10-28 15:58:07][WARN][aw_transform::flood]: Gap was of negative duration and could NOT be safely merged (-PT7.273864157Ss). This warning will only show once per batch.
[2024-10-28 16:02:03][INFO][aw_sync]: Pulling from all hosts
[2024-10-28 16:02:03][INFO][aw_sync::util]: Found remotes: ["linux-hp"]
[2024-10-28 16:02:03][WARN][aw_sync::sync_wrapper]: More than one db found in sync folder for host, choosing largest db [DirEntry("/mnt/DC9B-C279/Documents/misc/ActivityWatch/linux-hp/5d64b3ca-8eec-4403-beeb-2e9913aea727_2/sqlite.db"), DirEntry("/mnt/DC9B-C279/Documents/misc/ActivityWatch/linux-hp/5d64b3ca-8eec-4403-beeb-2e9913aea727/test.db")]
[2024-10-28 16:02:03][INFO][aw_sync::sync]: Pulling...
[2024-10-28 16:02:03][INFO][aw_datastore::worker]: Sending close request to database
[2024-10-28 16:02:03][INFO][aw_datastore::worker]: DB Worker thread finished
[2024-10-28 16:02:03][INFO][aw_sync]: Pushing local data
[2024-10-28 16:02:03][INFO][aw_sync::sync]: Pushing...
[2024-10-28 16:02:03][INFO][aw_sync::sync]: Syncing AwClient(baseurl=Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(127.0.0.1)), port: Some(5600), path: "/", query: None, fragment: None }) to Datastore()
[2024-10-28 16:02:03][INFO][aw_sync::sync]:  ⟳  Syncing bucket 'aw-watcher-window_linux-hp'
[2024-10-28 16:02:03][INFO][aw_sync::sync]:    + Resuming at 2024-10-28T14:57:03.459369523Z
[2024-10-28 16:02:03][INFO][aw_sync::sync]:   = Synced 9 new events
[2024-10-28 16:02:03][INFO][aw_sync::sync]:  ⟳  Syncing bucket 'aw-watcher-afk_linux-hp'
[2024-10-28 16:02:03][INFO][aw_sync::sync]:    + Resuming at 2024-10-28T14:57:03.459078931Z
[2024-10-28 16:02:03][INFO][aw_sync::sync]:   ✓ Already up to date!
[2024-10-28 16:02:03][INFO][aw_datastore::worker]: Sending close request to database
[2024-10-28 16:02:03][INFO][aw_sync]: Sync pass done, sleeping for 5 minutes
[2024-10-28 16:02:03][INFO][aw_datastore::worker]: DB Worker thread finished

From my tests, I have a few speculations that I want to confirm:

  • Do I need to wait quite a while for it to complete syncing? Since I see that aw_sync only do syncing periodically then sleep for 5 minutes. [2024-10-28 16:02:03][INFO][aw_sync]: Sync pass done, sleeping for 5 minutes
  • If there are similar hostnames, will it only choose 1 and discard all others, or will it merge everything into the largest ones? [2024-10-28 16:02:03][WARN][aw_sync::sync_wrapper]: More than one db found in sync folder for host, choosing largest db [DirEntry("/mnt/DC9B-C279/Documents/misc/ActivityWatch/linux-hp/5d64b3ca-8eec-4403-beeb-2e9913aea727_2/sqlite.db"), DirEntry("/mnt/DC9B-C279/Documents/misc/ActivityWatch/linux-hp/5d64b3ca-8eec-4403-beeb-2e9913aea727/test.db")]

DivineMK avatar Oct 28 '24 15:10 DivineMK

They share hostname though.

This is a big no-no. I don't even want to think about all the ways in which it can break things.

P.S. I am not sure if this is issue from awatcher or the webui from ActivityWatch so I post the issues on both, sorry for the inconvenience 😓

That's fine, but please do link the other issues.

If there are similar hostnames, will it only choose 1 and discard all others, or will it merge everything into the largest ones?

Ignores the others.

I've been meaning to fix issues like this by https://github.com/ActivityWatch/activitywatch/issues/302, but it's not completed since bucket ID names are difficult to migrate.

ErikBjare avatar Oct 29 '24 15:10 ErikBjare

I see thank you for your clarification.

  • So does this mean that I should keep every device's hostname different? I wonder if there is a way to modify a database to do this?
  • Should I close the issue on awatcher as it seems unrelated to it?

DivineMK avatar Oct 29 '24 16:10 DivineMK

I have the same issue. It only happened when I switched from aw-server to aw-server-rust. I followed the guide to autorun aw-server-rust, and it ran on startup, but now it shows nothing in the activity panel, no matter how many times I refresh.

Activity Panel Timeline Panel

OS: Windows 11 Pro v10.0.26100 Build 26100 ActivityWatch version: v0.13.2 (rust)

I have 2 workarounds for this to work. This sometimes works in a single try and sometimes takes me multiple tries. Sometimes, workaround 1 works, and other times, workaround 2 does.

I follow these steps every time ActivityWatch starts for Workaround 1:

  • Disable aw-server-rust.
  • Refresh the activity panel.
  • Enable aw-server.
  • Refresh the activity panel.
  • Disable aw-server.
  • Refresh the activity panel.
  • Enable aw-server-rust.
  • Refresh the activity panel.

I follow these steps every time ActivityWatch starts for Workaround 2:

  • Disable aw-server-rust.
  • Refresh the activity panel.
  • Enable aw-server-rust.
  • Refresh the activity panel.

I have these watchers enabled on startup:

Image

I have to try the workarounds every day I log into my PC.

Satanarious avatar Jan 16 '25 12:01 Satanarious

I have the same issue as @Satanarious. I switched to the aw-server-rust and set the auto start modules, then this NO DATA issue appears. I have to also follow the workarounds to get the views to display. Same modules as well except that I do not have the media one.

On Startup:

Image

Modules Active:

Image

do Workaround: Stop aw-server-rust > Start aw-server > stop aw-server > start aw-server-rust

After refreshing, the data is somewhat there but incomplete

Image

do workaround again with refreshes:

Image

stephangrobler avatar Feb 25 '25 04:02 stephangrobler

I noticed that I have a synced bucket for the device I was on when the no data issue occurred. I subsequently removed the synced buckets and now it seems to be working again as expected. @Satanarious maybe check on your side if you have the same buckets and maybe remove the synced ones?

stephangrobler avatar Feb 26 '25 23:02 stephangrobler

@stephangrobler thanks. It's working fine for me now after turning the sync bucket off and removing it from auto starting.

Satanarious avatar Feb 27 '25 00:02 Satanarious

Hey, I encountered the same issue. Where can I turn off the sync bucket?

hornhaut avatar Mar 23 '25 17:03 hornhaut

Hey, I encountered the same issue. Where can I turn off the sync bucket?

You can see all buckets under the 'Raw Data' menu item. The issue I encountered was a duplicate bucket with the same machine I was on. I removed the sync bucket from the machine I was on and it seems to have resolved the issue.

stephangrobler avatar Mar 23 '25 23:03 stephangrobler

Thank you! Solved it :)

hornhaut avatar Mar 24 '25 11:03 hornhaut