Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wakatime Doesnt work on github codespaces, config file missing #1035

Closed
Ishannaik opened this issue Mar 19, 2024 · 10 comments
Closed

Wakatime Doesnt work on github codespaces, config file missing #1035

Ishannaik opened this issue Mar 19, 2024 · 10 comments
Assignees
Labels
bug Something isn't working triage

Comments

@Ishannaik
Copy link

Environment:

  • OS: Codespaces (linux?)
  • Platform:

image
there is no config file present for spaces and popup repeatedly comes up to enter api key
image

@Ishannaik Ishannaik added the bug Something isn't working label Mar 19, 2024
@alanhamlett
Copy link
Member

Codespaces runs in a cloud server environment. Did you open a terminal and check for the config file at /home/codespaces/.wakatime.cfg? I just tested and it's working for me in github codespaces.

@alanhamlett alanhamlett self-assigned this Mar 19, 2024
@Ishannaik
Copy link
Author

Ishannaik commented Mar 19, 2024

Codespaces runs in a cloud server environment. Did you open a terminal and check for the config file at /home/codespaces/.wakatime.cfg? I just tested and it's working for me in github codespaces.

Yup a config file exists there and after opening it, it does indeed have the api key I pasted when I opened it on VSCode, I have also noticed Every time I start the Codespace or vscode I am asked for the API key again
image

@alanhamlett
Copy link
Member

What's the contents of /home/codespaces/.wakatime/wakatime.log

@Ishannaik
Copy link
Author

Ishannaik commented Mar 19, 2024

Launching codespaces always gives me this popup
image
Getting the error
image

API Key not found. /home/codespaces/.wakatime/wakatime.log
image

I have double checked grabbing the Secret API Key: from https://wakatime.com/settings/account

.wakatime.cfg
image

@alanhamlett
Copy link
Member

Please add this line at the end of your .wakatime.cfg file:
debug = true

Then after a while check your /home/codespaces/.wakatime/wakatime.log file to see if it's looking in the wrong location for the api key, or if there's another reason it couldn't read the api key.

@Ishannaik
Copy link
Author

{"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-03-20T05:03:06Z","os/arch":"linux/amd64","version":>
{"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: .w>
{"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-03-20T05:03:07Z","os/arch":"linux/amd64","version":>
{"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: .w>
{"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: .w>
{"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: .w>
{"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-03-21T02:34:49Z","os/arch":"linux/amd64","version":>

this is being spammed in the logs after adding debug = true

@alanhamlett
Copy link
Member

Looks like your /home/codespaces/.wakatime.cfg file is corrupted somehow? At least that's what this error means:

error parsing config file: While parsing config: key-value delimiter not found

Try deleting your /home/codespaces/.wakatime.cfg file then reload the window and re-enter the api key.

@Ishannaik
Copy link
Author

Still having the same issue, I've tried different repos as well as creating new codespaces too
The plugin works perfectly fine in Native VSCode, I'm just having issues with the codespace, I've tried opening the codespace in the browser aswell as the open in VSCode option, both are giving me the error somehow

@alanhamlett
Copy link
Member

I'm not able to reproduce this on a GitHub codespace opened in the browser. When the codespace first launches and VSCode in the browser opens, I'm prompted to enter my WakaTime API Key. After entering the key, it saves the key correctly to /home/codespaces/.wakatime.cfg and never asks for it again. I verified stopping the codespace then restarting and reopening it also doesn't prompt and correctly uses the saved key from the config file.
Screenshot 2024-03-23 at 8 53 59 AM

@alanhamlett
Copy link
Member

We have too many issues open for this. Let's continue debugging in wakatime/vscode-wakatime#362.

@wakatime wakatime locked and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants