Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
DivineMK opened this issue Oct 28, 2024 · 4 comments
Open
2 tasks done

Comments

@DivineMK
Copy link

DivineMK commented Oct 28, 2024

  • I am on the latest ActivityWatch version.
  • 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 😓

Copy link

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

@DivineMK
Copy link
Author

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")]

@ErikBjare
Copy link
Member

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 #302, but it's not completed since bucket ID names are difficult to migrate.

@DivineMK
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants