wakatime/wakatime-cli

key-value delimiter not found

skeeperloyaltie opened this issue · 1 comments

          Can you turn on debug mode, then share your vscode dev console logs when it happens again?

Originally posted by @alanhamlett in #691 (comment)

        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"}```

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.