Wakatime + GitPod bug reproduction
Error message
Reproduction
CLI version: v1.49.0
Extension version: v18.1.5
- Create a gitpod.io account
- Add the WAKATIME_API_KEY variable here: https://gitpod.io/variables (with value from https://wakatime.com/api-key)
- Open this repository using GitPod
- Edit a file to trigger WakaTime reporting
- You will see the error message
- Execute
> WakaTime: Api Key
and set your API key manually - Edit a file. Everything will work.
Versions
v18.1.5: reproduces v18.1.0: OK <-- I'll stay with this version until the bug is resolved v17.1.0: OK
To test another version, edit .gitpod.yml
Debugging information
.wakatime.log
My .wakatime.log
says that my API key is invalid. But it is!
{"caller":"cmd/run.go:276","func":"cmd.runCmd","level":"error","message":"failed to run command: today fetch failed: invalid api key... find yours at wakatime.com/api-key. failed to load api key","now":"2022-06-17T19:51:28Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","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: failed to load api key","now":"2022-06-17T19:51:44Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","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: failed to load api key","now":"2022-06-17T19:51:46Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","func":"cmd.runCmd","level":"error","message":"failed to run command: today fetch failed: invalid api key... find yours at wakatime.com/api-key. failed to load api key","now":"2022-06-17T19:53:27Z","version":"v1.49.0"}
{"caller":"cmd/run.go:111","func":"cmd.Run","level":"debug","message":"command: heartbeat","now":"2022-06-17T19:53:55Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","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: failed to load api key","now":"2022-06-17T19:53:55Z","version":"v1.49.0"}
{"caller":"cmd/run.go:111","func":"cmd.Run","level":"debug","message":"command: heartbeat","now":"2022-06-17T19:54:07Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","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: failed to load api key","now":"2022-06-17T19:54:07Z","version":"v1.49.0"}
{"caller":"cmd/run.go:111","func":"cmd.Run","level":"debug","message":"command: heartbeat","now":"2022-06-17T19:54:10Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","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: failed to load api key","now":"2022-06-17T19:54:10Z","version":"v1.49.0"}
{"caller":"cmd/run.go:111","func":"cmd.Run","level":"debug","message":"command: heartbeat","now":"2022-06-17T19:54:11Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","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: failed to load api key","now":"2022-06-17T19:54:11Z","version":"v1.49.0"}
{"caller":"cmd/run.go:99","func":"cmd.Run","level":"debug","message":"command: today","now":"2022-06-17T19:54:27Z","version":"v1.49.0"}
{"caller":"cmd/run.go:276","func":"cmd.runCmd","level":"error","message":"failed to run command: today fetch failed: invalid api key... find yours at wakatime.com/api-key. failed to load api key","now":"2022-06-17T19:54:27Z","version":"v1.49.0"}
Terminal
gitpod /workspace/wakatime-gitpod-repro (main) $ echo $WAKATIME_API_KEY
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
VSCode Developer Tools
Undefined env variable
$ process.env.WAKATIME_API_KEY
> undefined
Error logs
The following error lines were present:
After adding the API key manually, everything works.
Executing the command manually
Executing the command manually results in a 104 exit code, even in a terminal where the environment variable is set.
Misc
gitpod /workspace/wakatime-gitpod-repro (main) $ cat ~/.wakatime-internal.cfg
[internal]
cli_version = v1.49.0
cli_version_last_modified = Mon, 13 Jun 2022 15:48:47 GMT
gitpod /workspace/wakatime-gitpod-repro (main) $ cat ~/.wakatime.cfg
[settings]
debug = true