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.2k stars 133 forks source link

[WakaTime] [ERROR] Invalid API Key (104); Make sure your API Key is correct! for Version 24.0.10 #341

Closed MarkLester10 closed 1 year ago

MarkLester10 commented 1 year ago

I am using VSCODE Extension for wakatime and I am setting my api key thru VSCode but it keeps showing error saying Invalid API Key (104); Make sure your API Key is correct!. I already generated new api key from my WAKA TIME profile settings.

alanhamlett commented 1 year ago

I had to invalidate your api key because it was shared publicly here. If you go to https://wakatime.com/api-key and copy/paste your new key into vscode-wakatime's api key setting does it work?

MarkLester10 commented 1 year ago

I had to invalidate your api key because it was shared publicly here. If you go to https://wakatime.com/api-key and copy/paste your new key into vscode-wakatime's api key setting does it work?

still have the same error, Invalid API key, I reinstall the extension and generate api key and the same problem occurs

alanhamlett commented 1 year ago

Are there any error messages in your ~/.wakatime/wakatime.log file?

MarkLester10 commented 1 year ago

Are there any error messages in your ~/.wakatime/wakatime.log file?

Where can i find this file?

MarkLester10 commented 1 year ago

Here is the error from wakatime.log file

{"caller":"cmd/offline/offline.go:63","func":"offline.loadParams","level":"warning","message":"failed to load API parameters: api key not found or empty","now":"2023-04-25T22:01:35+08:00","os/arch":"darwin/arm64","version":"v1.73.0"} {"caller":"cmd/run.go:301","file":"/Users/marklestermorta/.wakatime/wakatime-internal.cfg","func":"cmd.runCmd","level":"error","lineno":1,"message":"failed to run command: sending heartbeat(s) failed: invalid api key... find yours at wakatime.com/api-key. api key not found or empty","now":"2023-04-25T22:01:35+08:00","os/arch":"darwin/arm64","time":1682431295.319011,"version":"v1.73.0"}

Mwansasquared commented 1 year ago

I noticed that the issue resulted from the Wakatime API Key being unable to be updated even after generating a new key. I had to uninstall the extension, reload VS Code, then reinstall the extension, and paste the newly generated key, that fixed it for me.

alanhamlett commented 1 year ago

Fixed in v24.2.0 by prompting to enter your api key when the it's invalid.