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.25k stars 137 forks source link

failed to run command: sending heartbeat(s) later due to api error #271

Closed jiang-yuan closed 2 years ago

jiang-yuan commented 2 years ago

{"caller":"cmd/run.go:239","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later due to api error: invalid response status from \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\". got: 429, want: 201/202. body: \"{\\\"error\\\":\\\"Consuming heartbeats has been disabled for this account.\\\"}\\n\"","now":"2022-05-07T15:40:49+08:00","version":"v1.44.0"}

I connect to a remote host.

alanhamlett commented 2 years ago

That's because of too many emails sent to you about a malfunctioning plugin. I've re-enabled consuming heartbeats for your account now.

jiang-yuan commented 2 years ago

That's because of too many emails sent to you about a malfunctioning plugin. I've re-enabled consuming heartbeats for your account now.

Because I opened vscode in my desktop and do not use it for last 2 weeks. It reported me work 24 hours every day.

jiang-yuan commented 2 years ago

Sorry to tell you that my account still cannot record waketime until now. Can you double check?

alanhamlett commented 2 years ago

What error do you see now in your ~/.wakatime.log file?

Weidows commented 1 year ago

@alanhamlett hello!

I also find this problem when using Windows and Mac at the same time

but strangely, only wakatime on Mac can't work, windows's works well

Now last for a week more, I don't know if its caused by keeping IDE alive too much time

here's log:

{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T10:47:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T10:48:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T10:51:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T10:54:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T10:56:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T10:57:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T11:01:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T11:43:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T11:51:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T12:05:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T12:05:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T12:06:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T12:07:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T12:10:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T12:16:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T12:18:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T12:24:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T12:32:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T15:06:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:16:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:17:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:19:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:20:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:20:54+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:21:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:22:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: today fetch failed: 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\": unexpected EOF","now":"2022-10-18T15:23:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:23:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:25:24+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T15:27:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T16:21:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T16:21:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T16:22:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T16:22:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T18:06:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T18:22:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T18:23:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T19:24:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T19:33:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T19:35:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T19:38:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T19:43:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T19:45:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T19:47:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","func":"cmd.runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later because currently rate limited: won't send heartbeat due to backoff","now":"2022-10-18T19:47:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T19:55:53+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T21:11:23+08:00","version":"v1.55.2"}
{"caller":"cmd/run.go:270","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\": proxyconnect tcp: EOF","now":"2022-10-18T21:11:53+08:00","version":"v1.55.2"}
DragonFishYL commented 1 year ago

That's because of too many emails sent to you about a malfunctioning plugin. I've re-enabled consuming heartbeats for your account now.

I also have the same problem, how to solve it

alanhamlett commented 1 year ago

@alanhamlett hello!

I also find this problem when using Windows and Mac at the same time

but strangely, only wakatime on Mac can't work, windows's works well

Now last for a week more, I don't know if its caused by keeping IDE alive too much time

The backoff is just a symptom of the problem. In your logs you can see the real error is an invalid proxy being used:

proxyconnect tcp: EOF

Please remove any proxy line from your ~/.wakatime.cfg file and it should start working.

noopurphalak commented 12 months ago

That's because of too many emails sent to you about a malfunctioning plugin. I've re-enabled consuming heartbeats for your account now.

I am also getting the following errors. @alanhamlett would you please check why that is? Here is the log from wakatime.log:

{"caller":"cmd/run.go:301","file":"/Users/noopur/Documents/repos/pixeldust-knowledge-base/.vitepress/cache/deps/@theme_index.js","func":"cmd.runCmd","level":"error",  "lineno":1,"message":"failed to run command: sending heartbeat(s) failed: api error: failed making request to \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\": retry request failed: Post \"https://2604:a880:4:1d0::2a7:b000/api/v1/users/current/heartbeats.bulk\": dial tcp [2604:a880:4:1d0::2a7:b000]:443:    connect: no route to host. original error: Post \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\": dial tcp: lookup api.wakatime.com: no such host",   "now":"2023-04-19T14:35:06+05:30","os/arch":"darwin/amd64","plugin":"vscode/1.77.3 vscode-wakatime/24.0.10","time":1681895106.713183,"version":"v1.73.0"}
{"caller":"cmd/run.go:301","file":"/Users/noopur/Documents/repos/pixeldust-knowledge-base/node_modules/vitepress/dist/client/theme-default/styles/components/custom-   block.css","func":"cmd.runCmd","level":"error","lineno":1,"message":"failed to run command: sending heartbeat(s) failed: rate limited: won't send heartbeat due to backoff","now":"2023-04-19T14:35:21+05:30","os/arch":"darwin/amd64","plugin":"vscode/1.77.3 vscode-wakatime/24.0.10","time":1681895121.854476,"version":"v1.73.0"}
alanhamlett commented 12 months ago

@noopurphalak check if you have a proxy defined in ~/.wakatime.cfg.

noopurphalak commented 12 months ago

@alanhamlett Please find below my ~/.wakatime/wakatime-internal.cfg:

[internal]
backoff_at                = 2025-06-07T18:23:30+05:30
backoff_retries           = 1
cli_version = v1.85.2
cli_version_last_modified = Sun, 08 Oct 2023 14:41:42 GMT
alanhamlett commented 11 months ago

That's the internal config, the proxy would be in the main config at ~/.wakatime.cfg.

noopurphalak commented 11 months ago

@alanhamlett Please find below the code in ~/.wakatime.cfg:

[settings]
api_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[internal]
backoff_at      = 2022-05-04T18:17:56+05:30
backoff_retries = 1
alanhamlett commented 11 months ago

I notice a strange time in the future 2025-06-07T18:23:30+05:30 is that correct? Maybe your computer time was incorrect? Try deleting ~/.wakatime/wakatime-internal.cfg and see if it's fixed.

noopurphalak commented 11 months ago

@alanhamlett I deleted the ~/.wakatime/wakatime-internal.cfg yesterday. But the still the wakatime counter on vscode is at 0 secs today. Please find below the contents of ~/.wakatime.cfg:

[settings]
 api_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 [internal]
 backoff_at      = 2022-05-04T18:17:56+05:30
 backoff_retries = 1
alanhamlett commented 11 months ago

I've moved this to #371 because it's not related to this issue.