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.21k stars 134 forks source link

Invalid Api Key (104); Make sure your Api Key is correct! #331

Closed ifyour closed 1 year ago

ifyour commented 1 year ago

I have verified that the API Key is correct, but it still shows an error.

This is the last log after enabling debug:

{
  "caller": "cmd/run.go:270",
  "func": "cmd.runCmd",
  "level": "error",
  "message": "failed to run command: sending heartbeat(s) failed: invalid api key... find yours at wakatime.com/api-key. failed to load command parameters: failed to load api params: invalid api key format",
  "now": "2023-03-27T09:44:26+08:00",
  "version": "v1.55.2"
}
alanhamlett commented 1 year ago

Version 1.55.2 is old, can you update to the latest wakatime-cli release: https://github.com/wakatime/wakatime-cli

Vscode should be doing that for you, unless it can't connect to GitHub to check for new releases.

ifyour commented 1 year ago
{
  "caller": "cmd/run.go:292",
  "file": "/Users/xxx/.wakatime.log",
  "func": "cmd.runCmd",
  "level": "error",
  "lineno": 334,
  "message": "failed to run command: sending heartbeat(s) failed: rate limited: won't send heartbeat due to backoff",
  "now": "2023-03-27T22:26:34+08:00",
  "os/arch": "darwin/amd64",
  "plugin": "vscode/1.76.2 vscode-wakatime/24.0.7",
  "time": 1679927194.6296132,
  "version": "v1.70.0"
}
alanhamlett commented 1 year ago

That's a networking issue. Are you behind a proxy or does your ISP block some websites?

ifyour commented 1 year ago

It is indeed a network issue. After adding a proxy, the problem was resolved. Thank you for your response!

VS Code Settings.json :

  "http.proxySupport": "on",
  "http.proxy": "http://127.0.0.1:1080",