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

Unable to get api key: Error: spawn UNKNOWN #295

Open
krishnans2006 opened this issue Aug 31, 2022 · 5 comments
Open

Unable to get api key: Error: spawn UNKNOWN #295

krishnans2006 opened this issue Aug 31, 2022 · 5 comments

Comments

@krishnans2006
Copy link

I installed the WakaTime VSCode extension, and entered my API Key. However, every few seconds, I am prompted to enter a new API key. On inspecting the developer console, I see the following from the WakaTime extension. Any ideas, or ways I can fix this?

image

@alanhamlett
Copy link
Member

That error happens when vscode isn't able to read/write to your ~/.wakatime.cfg file. What OS are you using?

@krishnans2006
Copy link
Author

I'm on Windows - it is on somewhat of a restricted policy, so that may be the case (works fine on my other Linux PC). Although I don't see how it would be a problem to access a file in my home folder... (I'm assuming C:\Users\username\.wakatime.cfg).

I'll try to manually edit the file with my API key and see if that helps (in case it's only writes that don't work). Thanks for the help, I'll keep you posted!

@alanhamlett
Copy link
Member

I'll try to manually edit the file with my API key and see if that helps

That should work. You still might get a warning on first startup when the plugin writes the ~/.wakatime-internal.cfg with it's last update check time but you can ignore that warning and the plugin will still work.

@krishnans2006
Copy link
Author

So the extension wrote the API key perfectly in ~/.wakatime.cfg.


[settings]
api_key = the_key

However, it can't read the API key it just wrote...

image

And my user definitely has read/write access to the file (I can open it up in Notepad and make changes as I please). Any ideas?

@alanhamlett
Copy link
Member

The first two logs are normal, because at that time you hadn't entered your api key yet and the plugin was trying to read a file that didn't exist. Those two warnings are normal.

Then, after you entered your api key the third message (spawn UNKNOWN) occurred. That error sounds very similar to this previous issue. That issue was Windows Defender blocking the plugin.

It still seems like Windows isn't letting vscode read files in your user home folder. Can you open other files in your user home folder using vscode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants