Skip to content

Firefox watcher not logging data #32

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

Open
wonhyeongseo opened this issue Apr 24, 2019 · 13 comments
Open

Firefox watcher not logging data #32

wonhyeongseo opened this issue Apr 24, 2019 · 13 comments

Comments

@wonhyeongseo
Copy link

wonhyeongseo commented Apr 24, 2019

Hello, I installed Activity Watcher today on Ubuntu 18.04 with Firefox 66.0.3. Thank you very much for making this software.

I added the firefox web watcher a few hours ago, but there is no data in the aw-watcher-web-firefox bucket. aw-watcher-window bucket is logging Firefox window titles fine. Might the problem be that I clear firefox Data (including cache) and History daily?

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Apr 24, 2019

I added the firefox web watcher a few hours ago, but there is no data in the aw-watcher-web-firefox bucket.

So the bucket is created but there is no data in it, correct? Are you looking in the "Activity" tab or in the "Raw Data" tab? If there is not even any data inside the bucket in "Raw Data" you should find the aw-server log file or debug the firefox addon as there is an issue in one of them but not sure which. How to debug addons on firefox you can Google and the aw-server log relies in ~/.cache/activitywatch/aw-server on Linux.

Might the problem be that I clear firefox Data (including cache) and History daily?

That doesn't matter, aw-watcher-web does not look at the browsers built-in history but as long as the extension is enabled it will track every website you visit similar to the browser history. The reason why we essentially create yet another history is because the built-in browser history does not include the duration the user visited the site which is very important for ActivityWatch to be an useful tool.

@wonhyeongseo
Copy link
Author

wonhyeongseo commented Apr 25, 2019

So the bucket is created but there is no data in it, correct? Are you looking in the "Activity" tab or in the "Raw Data" tab?

Correct. I am looking in the "Raw Data" tab.

The aw-server log file does not receive a "heartbeat" from Firefox, so there is no

Received heartbeat, but bucket was previously empty, inserting as new event. (bucket: aw-watcher-web-firefox)

in the 3 log files currently generated.

Also, I noticed the Firefox addon display 'Running: checked' but its 'Last sync: never'. Below is output from the debug console.

Setting up client app.js:1806:5
testing: false app.js:1810:7
error occurred while processing 'sources: TypeError: can't access dead object
Stack: createSourceActor@resource://devtools/server/actors/utils/TabSources.js:240:5
onSources@resource://devtools/server/actors/thread.js:1238:7
onPacket@resource://devtools/server/main.js:1286:15
receiveMessage@resource://devtools/shared/transport/child-transport.js:66:5
Line: 240, column: 5 main.js:1155
    _unknownError resource://devtools/server/main.js:1155
    onPacket resource://devtools/server/main.js:1289
    receiveMessage resource://devtools/shared/transport/child-transport.js:66

@johan-bjareholt
Copy link
Member

sources: TypeError: can't access dead object

Aha. It's most likely that for some reason your browser is quick at dropping the info about the tabs which aw-watcher-web has a reference to.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Dead_object

Maybe we could fix this by simply cloning the object, not sure though.

@wonhyeongseo
Copy link
Author

I'll be happy to give it a try. How would I clone the object?

May I ask of the tested Firefox's privacy preferences? Changed mine from 'strict' to 'standard', restarted my machine and no difference is seen.

@wonhyeongseo
Copy link
Author

Watcher is still not working and I haven't figured out how to clone the object. May you please help me?

@johan-bjareholt
Copy link
Member

I have had a similar issue now actually, but it did not occur at all at when I expected it to.

I was testing the aw-server-rust server instead of the standard aw-server-python server and that responded with another response than aw-server-python which aw-watcher-web did not expect. Things did still work as expected but I got the same constant "sources: TypeError: can't access dead object" error message.

What version of activitywatch are you running? I assume that you are not running aw-server-rust?

@johan-bjareholt
Copy link
Member

If you have the time to debug, please try out the aw-watcher-web branch in #33 and look at the console, should hopefully provide better error messages

@johan-bjareholt
Copy link
Member

I'll close this, have not seen the issue in a very long time.

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Oct 10, 2020

A user on the forum reported that this might be because of a setting in firefox

https://forum.activitywatch.net/t/unable-to-connect-to-server-with-aw-watcher-web-firefox

This should be documented!

@drj-vk
Copy link

drj-vk commented Oct 12, 2020

The setting comes from setting Firefox to never remember history:
image

When set, no connection is made to the aw-server

@renyuneyun
Copy link

I have a similar issue, and does not set "never remember history".
The browser extension says it was "last synced" 4 days ago (2023/4/7 17:37:36), though the bucket in AW is empty.

The most recent log file (3 days ago) does not have aw-watcher-web-firefox. For all log files, only 3 of them has. Most recent one is (aw-server_2023-04-02T18-20-19.log):

2023-04-07 16:40:23 [INFO ]: Received heartbeat after pulse window, inserting as new event. (bucket: aw-watcher-web-firefox)  (aw_server.api:279)

I'm on Linux and currently on Wayland, so currently no browsing history is recorded at all... But I can confirm AW is working as I do have some logs (probably applications using XWayland); previously on X11 AW was working fine.

My previous attempt (2 months ago) with Firefox Developer Edition with custom build of the extension also had no data. I thought it was because of custom build, but now it looks like it's not.

@kw-pr
Copy link

kw-pr commented Mar 5, 2025

I have the same problem with v0.5.0, Firefox 135.0.1 (64-Bit), Ubuntu 22.04.5 LTS (Wayland).

Every day no data is logged. If I open the extensions dev tools and reload it starts to work. Like it is just not starting up. Maybe because my Firefox is restoring tabs?

@BelKed
Copy link
Contributor

BelKed commented Mar 5, 2025

@kw-pr Hi, it might have been in fixed the recent commits. To install, follow the instructions in the README :)

If it doesn't work, try to check the logs — for that ideally install Firefox Developer Edition, install just the ActivityWatch extension and open Browser Console (Ctrl+Shift+J). You'll probably need to switch it to Multiprocess to see logs from the extension.

And, lastly, it might be an issue on the UI side; please check if you have data in these three buckets:

  1. Go to http://localhost:5600/#/timeline
  2. Check if you have for all time periods that you were using browser:
    i. non-afk status (optional)
    ii. data from browser extension
    iii. data from window watcher with the correct browser name — it can't be unknown

Example:

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

No branches or pull requests

6 participants