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

an unknown error (112) is encountered #286

Closed shigma closed 2 years ago

shigma commented 2 years ago
image

My wakatime extension wasn't working for several hours (the part outlined in red is the missing coding time):

image

The final lines of my .wakatime.log:

{"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-07-28T23:57:43+08:00","version":"v1.53.3"}
{"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-07-28T23:59:43+08:00","version":"v1.53.3"}
{"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-07-29T00:02:43+08:00","version":"v1.53.3"}
{"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-07-29T00:03:08+08:00","version":"v1.53.3"}
{"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-07-29T00:03:09+08:00","version":"v1.53.3"}
{"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-07-29T00:03:17+08:00","version":"v1.53.3"}
{"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-07-29T00:05:43+08:00","version":"v1.53.3"}
{"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-07-29T00:05:58+08:00","version":"v1.53.3"}
{"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-07-29T00:05:59+08:00","version":"v1.53.3"}
{"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-07-29T00:06:03+08:00","version":"v1.53.3"}
{"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-07-29T00:07:43+08:00","version":"v1.53.3"}
{"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-07-29T00:08:04+08:00","version":"v1.53.3"}
{"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-07-29T00:10:08+08:00","version":"v1.53.3"}
{"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-07-29T00:12:11+08:00","version":"v1.53.3"}
{"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-07-29T00:16:07+08:00","version":"v1.53.3"}
{"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-07-29T00:18:30+08:00","version":"v1.53.3"}
{"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-07-29T00:22:00+08:00","version":"v1.53.3"}
{"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-07-29T00:24:56+08:00","version":"v1.53.3"}
{"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-07-29T00:26:39+08:00","version":"v1.53.3"}

Additional notes: I use vscode and IDEA interchangeably, but neither of them reported coding time. I am not sure which editor this issue is related to, so I am also submitting the same issue in the other repository.

alanhamlett commented 2 years ago

When wakatime-cli fails to upload stats, it saves them to a local database then tries to send them later. Does that missing time show up on your dashboard after now?

shigma commented 2 years ago

Thanks for your response.

No. Today's coding time only includes my time on another laptop. My vscode and IDEA is still not working.

image

alanhamlett commented 2 years ago

Oh got it, then since no time from that machine is sent it won't be able to upload the offline data. The error message mentions a proxy error. Try removing any proxy configuration in your ~/.wakatime.cfg file.

shigma commented 2 years ago

Now it works! Thanks a lot.