wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
262 stars 40 forks source link

key-value delimiter not found #1010

Closed skeeperloyaltie closed 5 months ago

skeeperloyaltie commented 6 months ago
          Can you turn on debug mode, then share your vscode dev console logs when it happens again?

Originally posted by @alanhamlett in https://github.com/wakatime/wakatime-cli/issues/691#issuecomment-1093610492

        This here is my log from wakatime.log

{"caller":"cmd/offline/offline.go:63","func":"offline.loadParams","level":"warning","message":"failed to load API parameters: api key not found or empty","now":"2024-01-12T02:15:06+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/offline/offline.go:63","func":"offline.loadParams","level":"warning","message":"failed to load API parameters: api key not found or empty","now":"2024-01-12T02:15:11+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/run.go:58","func":"cmd.Run","level":"error","message":"failed to parse config files: failed to load configuration file: error parsing config file: While parsing config: key-value delimiter not found: waka_50d9c0d5-3ba5-4c99-a22c-ffc13d0e803a\n","now":"2024-01-12T02:16:06+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/offline/offline.go:63","func":"offline.loadParams","level":"warning","message":"failed to load API parameters: api key not found or empty","now":"2024-01-12T02:16:06+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/run.go:58","func":"cmd.Run","level":"error","message":"failed to parse config files: failed to load configuration file: error parsing config file: While parsing config: key-value delimiter not found: waka_50d9c0d5-3ba5-4c99-a22c-ffc13d0e803a\n","now":"2024-01-12T02:19:38+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/run.go:58","func":"cmd.Run","level":"error","message":"failed to parse config files: failed to load configuration file: error parsing config file: While parsing config: key-value delimiter not found: waka_50d9c0d5-3ba5-4c99-a22c-ffc13d0e803a\n","now":"2024-01-12T02:19:39+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/run.go:58","func":"cmd.Run","level":"error","message":"failed to parse config files: failed to load configuration file: error parsing config file: While parsing config: key-value delimiter not found: waka_50d9c0d5-3ba5-4c99-a22c-ffc13d0e803a\n","now":"2024-01-12T02:21:32+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/offline/offline.go:63","func":"offline.loadParams","level":"warning","message":"failed to load API parameters: api key not found or empty","now":"2024-01-12T02:21:32+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/run.go:58","func":"cmd.Run","level":"error","message":"failed to parse config files: failed to load configuration file: error parsing config file: While parsing config: key-value delimiter not found: waka_50d9c0d5-3ba5-4c99-a22c-ffc13d0e803a\n","now":"2024-01-12T02:22:48+03:00","os/arch":"linux/amd64","version":"v1.88.1"}
{"caller":"cmd/offline/offline.go:63","func":"offline.loadParams","level":"warning","message":"failed to load API parameters: api key not found or empty","now":"2024-01-12T02:22:48+03:00","os/arch":"linux/amd64","version":"v1.88.1"}```
alanhamlett commented 5 months ago

The error message from your logs above is:

failed to parse config files: failed to load configuration file: error parsing config file: While parsing config: key-value delimiter not found

That means your ~/.wakatime.cfg file has the api key on a line by itself. Change that line to start with api_key = and it will start working. You'll also need to generate a new api key, because GitHub Secret Scanning will have invalidated that api key since it's visible publicly here.