wakatime / vscode-wakatime

Visual Studio Code plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/vs-code
BSD 3-Clause "New" or "Revised" License
1.23k stars 137 forks source link

No activity shown for past 14 days #282

Closed samarthagarwal closed 2 years ago

samarthagarwal commented 2 years ago

I use wakatime across VS Code and Android Studio. It was working fine when I last checked around June 10, 2022. I noticed it yesterday that there is no activity shown for the last 14 days in my dashboard. I reinstalled both the extensions but still it does not seem to work. The status in the IDEs is shown as "initialized".

What should I do next?

alanhamlett commented 2 years ago

Does the status bar change from Initialized to something else when you save some changes in a file?

You should turn on debug mode and check your vscode dev console, and ~/.wakatime.log file. Most likely it's a networking issue but we won't know for sure until checking the logs: https://github.com/wakatime/vscode-wakatime#troubleshooting

samarthagarwal commented 2 years ago

I checked the logs and this is what I see towards the end.

{"caller":"cmd/run.go:276","func":"cmd.runCmd","level":"error","message":"failed to run command: today fetch failed: api error: failed fetching today from api: failed to make request to \"https://api.wakatime.com/api/v1/users/current/statusbar/today\": Get \"https://api.wakatime.com/api/v1/users/current/statusbar/today\": dial tcp 143.244.210.202:443: connect: operation timed out","now":"2022-06-18T12:20:16+05:30","version":"v1.48.1"}
{"caller":"cmd/run.go:276","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later due to api error: failed making request to \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\": Post \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\": dial tcp 143.244.210.202:443: connect: operation timed out","now":"2022-06-18T12:27:03+05:30","version":"v1.48.1"}

Also noted that the status of wakatime plugin in the status bar is always shown as Initialized.

alanhamlett commented 2 years ago

Do you possibly need a proxy to connect to the internet? If so, it can be set in your wakatime extension settings inside VS Code.

samarthagarwal commented 2 years ago

No. I do not need a proxy to connect to the internet. What else can I check?

alanhamlett commented 2 years ago

Try pinging the api:

ping api.wakatime.com

Also, do you have Docker installed? I think it's also built with Go and if it can connect to websites, for ex: when checking for updates, then we should be able to get wakatime-cli working too.

alanhamlett commented 2 years ago

Also, try adding this line to your ~/.wakatime.cfg file to get more verbose logs:

debug = true

samarthagarwal commented 2 years ago

ping api.wakatime.com works just fine. Also, as I checked, debug=true is already set.

alanhamlett commented 2 years ago

At least your stats should be safe in the offline db at ~/.wakatime.bdb, so when we get it working they'll sync up to your dashboard.

alanhamlett commented 2 years ago

I just noticed your wakatime-cli version is old: "version":"v1.48.1"

If you restart vscode, then check your vscode dev console window do you see it updating to v1.53.2?

samarthagarwal commented 2 years ago

For some reason, it has started working. I checked, and my stats for last 3 days are showing in the dashboard. I really do not know what fixed it.