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

[Error] Please enter your api key, go to https://codegpt.co/ for more information. #142

Closed
0x00A1FA opened this issue May 5, 2023 · 21 comments

Comments

@0x00A1FA
Copy link

0x00A1FA commented May 5, 2023

Can you please refactor your code and communicate better errors? I'm getting this even though I've set-up my API key.

@Chasty
Copy link

Chasty commented May 5, 2023

Same here :(

@topcheese
Copy link

topcheese commented May 6, 2023

Yeah I don't get it except for it may be an IDE issue. I think updating to the latest VS Code may fix it, but not on Codium ... at least on a Mac it doesn't work. I haven't gotten around to confirming it.

@topcheese
Copy link

topcheese commented May 8, 2023

So I'm on an old 2009 MBP and switched to the latest VS Code ... still doesn't work. I no longer get the error, but now it just returns with an empty reply.

Edit: It indeed looks like it accessed the API, looking at the OpenAI dashboard.

@Maol-1997
Copy link
Collaborator

Maol-1997 commented May 8, 2023

@topcheese

did you updated the extension ?

@topcheese
Copy link

topcheese commented May 8, 2023

@Maol-1997 No, I just installed VS Code from Brew, then installed from the marketplace within the IDE. I think my problem is with my graphics drivers and software. I just glanced at it, but I'm on Monterey 12.5.3 I think it said.
I remember reading somewhere that some plugins actually require some of the special code that comes along with the official version of VS Code.
My next plan is to update my OS to try and fix the graphic issues. I'm noticing text is not showing up in some other apps.

Edit: At least for me, I believe if it doesn't show up in the marketplace, then it might not properly work. I didn't notice this plugin in the Codium IDE, so I had to manually install it. I believe that is a clue.

@topcheese
Copy link

My understanding is that some 3rd party dependencies cannot be open-sourced with some plugins, and they can only be released for VS Code. Actually I think it's some of the code MS included in it, now that I'm remembering ... probably a little of both.
The developer can confirm this? I know they released it for some other IDEs, but I'm thinking Codium might be a special case being built off VS Code?

@Maol-1997
Copy link
Collaborator

Maol-1997 commented May 8, 2023

Codegpt oficial extension is in vscode only. It uses an vscode encripted storage to store the api keys, maybe in your os you need to send special permissions ?

@topcheese
Copy link

Thank you so much, that's just what I needed to hear. The developer should be able to close at least one ticket, and should probably should add the clarification in bold somewhere.

@adepeuf
Copy link

adepeuf commented May 9, 2023

same issue, and using vs code

@topcheese
Copy link

@adepeuf , which version, what platform, and is it the exact issue and error message?

@adepeuf
Copy link

adepeuf commented May 9, 2023

VS CODE:
Version: 1.73.0 (system setup)
Commit: 8fa188b2b301d36553cbc9ce1b0a146ccb93351f
Date: 2022-11-01T15:34:06.111Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

CODE GPT extension: v2.1.6

Error : althoug I've saved my API key every prompt to code gpt is immediately answered with "Please enter your api key, go to https://codegpt.co/ for more information." and on the bottom right of VS code there is another error message that pops up: "Enter your API KEY to save it securely."

@topcheese
Copy link

@adepeuf Your problem is wrong VS Code version, please update to the latest version. 1.78.

@adepeuf
Copy link

adepeuf commented May 10, 2023

@adepeuf Your problem is wrong VS Code version, please update to the latest version. 1.78.

works with 1.78, thank you

@pareekshithraj
Copy link

what is my api ?😒

@0x3N3jVhPUV
Copy link

Version: 1.79.1 (user setup)
Commit: 4cb974a7aed77a74c7813bdccd99ee0d04901215
Date: 2023-06-12T16:14:05.102Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19044

I still receiving the following message after entering my api key:
[[Error] Please enter your api key, go to https://codegpt.co/ for more information.]

I need help please

@rmeissn
Copy link

rmeissn commented Jul 12, 2023

I think I got the same problem. I'm using VScodium 1.80 and codeGPT 2.1.9. Whenever I set the API key, it seems it was set correctly. After restart of VScodium, the chat sidebar says I should set my API key (even though I did before).
I tried this several times and with different workflows. Other extensions (like Gitlab) is able to store API keys successfully.

Here's the log, that is thrown by this extension (not sure whether it is related):

2023-07-12 14:02:22.569 [error] TypeError: Cannot read properties of null (reading 'webview')
    at /.../.vscode-oss/extensions/danielsanmedium.dscodegpt-2.1.10-universal/src/extension.js:447:30
    at e.ExtHostCommands._executeContributedCommand (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:72243)
    at e.ExtHostCommands.$executeContributedCommand (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:99:73232)
    at t._doInvokeHandler (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:14416)
    at t._invokeHandler (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:14098)
    at t._receiveRequest (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:12856)
    at t._receiveOneMessage (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:11555)
    at i.value (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:111:9662)
    at b._deliver (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:60:2465)
    at b.fire (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:60:2784)
    at fire (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:76:16556)
    at i.value (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:36590)
    at b._deliver (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:60:2465)
    at b.fire (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:60:2784)
    at fire (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:76:16556)
    at MessagePortMain.<anonymous> (/usr/share/codium/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:127:34667)
    at MessagePortMain.emit (node:events:513:28)
    at Object.MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:367) codegpt.askCodeGPT {"value":"DanielSanMedium.dscodegpt","_lower":"danielsanmedium.dscodegpt"}

@rmeissn
Copy link

rmeissn commented Jul 12, 2023

The problem seems to stem from ChatSidebarProvider, lines 58 onwards.
The const apiKey is filled with:

{"_actual":null,"_actualOk":null,"_actualErr":null,"_hasValue":false,"_value":null,"_hasErr":false,"_err":null}

which is not an API key. This stems from the fact that context.secrets.get() is an async function, but there is no await. Thus, the constant is filled with a promise... Later the result of the promise is accessed with apiKey.g, which fails.
Simple fix:
make _update an async function and await for the api key. Use apiKey only, not apiKey.g
These changes fixed the plugin for me in VScodium. I'm uncertain whether this change breaks anything else....

@tiagonunocosta
Copy link

In my Mac Ventura i enter the API Key and I don’t receive any error but when I use the chat e receive a empty response
image

Can any one help me please

@silentsilas
Copy link

The problem seems to stem from ChatSidebarProvider, lines 58 onwards. The const apiKey is filled with:

{"_actual":null,"_actualOk":null,"_actualErr":null,"_hasValue":false,"_value":null,"_hasErr":false,"_err":null}

which is not an API key. This stems from the fact that context.secrets.get() is an async function, but there is no await. Thus, the constant is filled with a promise... Later the result of the promise is accessed with apiKey.g, which fails. Simple fix: make _update an async function and await for the api key. Use apiKey only, not apiKey.g These changes fixed the plugin for me in VScodium. I'm uncertain whether this change breaks anything else....

You're a lifesaver! Created a gist with those changes. Confirmed it's working for OpenAI on an M2 Macbook Pro running VSCodium v1.81.0

https://gist.github.com/silentsilas/c11acff9d65d04f40920ddb782d17195

@tiagonunocosta
Copy link

tiagonunocosta commented Aug 16, 2023 via email

@PilarHidalgo
Copy link
Collaborator

Hi everyone!

I hope you're all doing well. Please take a moment to update to the latest version here: Visual Studio Marketplace.

Thank you!

Repository owner locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests