SimiaCryptus/intellij-aicoder

Got this error on error on IntelliJ 2023,1,5

Closed this issue · 2 comments

Log Message: Error
Error Message: null
Error Type: java.lang.reflect.UndeclaredThrowableException
API Base: https://api.openai.com/v1
Token Counter: 0

OS: Mac OS X / 13.5 / aarch64
Locale: ES / en

Error Details:

java.lang.reflect.UndeclaredThrowableException
	at jdk.proxy5/jdk.proxy5.$Proxy289.editCode(Unknown Source)
	at com.github.simiacryptus.aicoder.actions.code.CustomEditAction$VirtualAPI$editCode.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:166)
	at com.github.simiacryptus.aicoder.actions.code.CustomEditAction.processSelection(CustomEditAction.groovy:77)
	at com.github.simiacryptus.aicoder.actions.code.CustomEditAction.processSelection(CustomEditAction.groovy)
	at com.github.simiacryptus.aicoder.actions.SelectionAction$processSelection$1.invoke(SelectionAction.kt:177)
	at com.github.simiacryptus.aicoder.actions.SelectionAction$processSelection$1.invoke(SelectionAction.kt:176)
	at com.github.simiacryptus.aicoder.util.UITools$run$1.compute(UITools.kt:831)
	at com.intellij.openapi.progress.Task$WithResult.run(Task.java:353)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:513)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: Incorrect API key provided: 0P0BhJ6V************************************nOsj. You can find your API key at https://platform.openai.com/account/api-keys.
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:588)
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:547)
	at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
	at com.simiacryptus.openai.HttpClientManager.runAsync(HttpClientManager.kt:168)
	at com.simiacryptus.openai.HttpClientManager.withCancellationMonitor(HttpClientManager.kt:115)
	at com.simiacryptus.openai.HttpClientManager.withCancellationMonitor(HttpClientManager.kt:100)
	at com.simiacryptus.openai.HttpClientManager$withReliability$1$1.invoke(HttpClientManager.kt:179)
	at com.simiacryptus.openai.HttpClientManager.withTimeout(HttpClientManager.kt:136)
	at com.simiacryptus.openai.HttpClientManager$withReliability$1.invoke(HttpClientManager.kt:178)
	at com.simiacryptus.openai.HttpClientManager.withExpBackoffRetry(HttpClientManager.kt:55)
	at com.simiacryptus.openai.HttpClientManager.withExpBackoffRetry$default(HttpClientManager.kt:51)
	at com.simiacryptus.openai.HttpClientManager.withReliability(HttpClientManager.kt:177)
	at com.simiacryptus.openai.HttpClientManager.withReliability$default(HttpClientManager.kt:176)
	at com.simiacryptus.openai.OpenAIClient.moderate(OpenAIClient.kt:427)
	at com.simiacryptus.openai.proxy.ChatProxy.complete(ChatProxy.kt:91)
	at com.simiacryptus.openai.proxy.GPTProxyBase.create$lambda$5(GPTProxyBase.kt:64)
	... 32 more
Caused by: java.lang.RuntimeException: java.io.IOException: Incorrect API key provided: 0P0BhJ6V************************************nOsj. You can find your API key at https://platform.openai.com/account/api-keys.
	at com.simiacryptus.openai.OpenAIClient$moderate$1$1.invoke(OpenAIClient.kt:453)
	at com.simiacryptus.openai.OpenAIClient$moderate$1$1.invoke(OpenAIClient.kt:428)
	at com.simiacryptus.openai.HttpClientManager.withPerformanceLogging(HttpClientManager.kt:186)
	at com.simiacryptus.openai.OpenAIClient$moderate$1.invoke(OpenAIClient.kt:428)
	at com.simiacryptus.openai.OpenAIClient$moderate$1.invoke(OpenAIClient.kt:427)
	at com.simiacryptus.openai.HttpClientManager.runAsync$lambda$7(HttpClientManager.kt:158)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	... 1 more
Caused by: java.io.IOException: Incorrect API key provided: 0P0BhJ6V************************************nOsj. You can find your API key at https://platform.openai.com/account/api-keys.
	... 12 more

Action History:

  • Action: CustomEditAction
  • Action: CustomEditAction
  • Action:

Error History:

Error

java.lang.NullPointerException
	at com.github.simiacryptus.aicoder.util.UITools.checkApiKey(UITools.kt:848)
	at com.github.simiacryptus.aicoder.util.UITools.checkApiKey$default(UITools.kt:842)
	at com.github.simiacryptus.aicoder.util.UITools.run(UITools.kt:818)
	at com.github.simiacryptus.aicoder.util.UITools.run$default(UITools.kt:807)
	at com.github.simiacryptus.aicoder.actions.SelectionAction.processSelection(SelectionAction.kt:176)
	at com.github.simiacryptus.aicoder.actions.SelectionAction.handle$lambda$0(SelectionAction.kt:59)
	at com.github.simiacryptus.aicoder.util.UITools.redoableTask$lambda$0(UITools.kt:78)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Error

java.lang.reflect.UndeclaredThrowableException
	at jdk.proxy5/jdk.proxy5.$Proxy289.editCode(Unknown Source)
	at com.github.simiacryptus.aicoder.actions.code.CustomEditAction$VirtualAPI$editCode.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:166)
	at com.github.simiacryptus.aicoder.actions.code.CustomEditAction.processSelection(CustomEditAction.groovy:77)
	at com.github.simiacryptus.aicoder.actions.code.CustomEditAction.processSelection(CustomEditAction.groovy)
	at com.github.simiacryptus.aicoder.actions.SelectionAction$processSelection$1.invoke(SelectionAction.kt:177)
	at com.github.simiacryptus.aicoder.actions.SelectionAction$processSelection$1.invoke(SelectionAction.kt:176)
	at com.github.simiacryptus.aicoder.util.UITools$run$1.compute(UITools.kt:831)
	at com.intellij.openapi.progress.Task$WithResult.run(Task.java:353)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:513)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: Incorrect API key provided: 0P0BhJ6V************************************nOsj. You can find your API key at https://platform.openai.com/account/api-keys.
	at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:588)
	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:547)
	at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
	at com.simiacryptus.openai.HttpClientManager.runAsync(HttpClientManager.kt:168)
	at com.simiacryptus.openai.HttpClientManager.withCancellationMonitor(HttpClientManager.kt:115)
	at com.simiacryptus.openai.HttpClientManager.withCancellationMonitor(HttpClientManager.kt:100)
	at com.simiacryptus.openai.HttpClientManager$withReliability$1$1.invoke(HttpClientManager.kt:179)
	at com.simiacryptus.openai.HttpClientManager.withTimeout(HttpClientManager.kt:136)
	at com.simiacryptus.openai.HttpClientManager$withReliability$1.invoke(HttpClientManager.kt:178)
	at com.simiacryptus.openai.HttpClientManager.withExpBackoffRetry(HttpClientManager.kt:55)
	at com.simiacryptus.openai.HttpClientManager.withExpBackoffRetry$default(HttpClientManager.kt:51)
	at com.simiacryptus.openai.HttpClientManager.withReliability(HttpClientManager.kt:177)
	at com.simiacryptus.openai.HttpClientManager.withReliability$default(HttpClientManager.kt:176)
	at com.simiacryptus.openai.OpenAIClient.moderate(OpenAIClient.kt:427)
	at com.simiacryptus.openai.proxy.ChatProxy.complete(ChatProxy.kt:91)
	at com.simiacryptus.openai.proxy.GPTProxyBase.create$lambda$5(GPTProxyBase.kt:64)
	... 32 more
Caused by: java.lang.RuntimeException: java.io.IOException: Incorrect API key provided: 0P0BhJ6V************************************nOsj. You can find your API key at https://platform.openai.com/account/api-keys.
	at com.simiacryptus.openai.OpenAIClient$moderate$1$1.invoke(OpenAIClient.kt:453)
	at com.simiacryptus.openai.OpenAIClient$moderate$1$1.invoke(OpenAIClient.kt:428)
	at com.simiacryptus.openai.HttpClientManager.withPerformanceLogging(HttpClientManager.kt:186)
	at com.simiacryptus.openai.OpenAIClient$moderate$1.invoke(OpenAIClient.kt:428)
	at com.simiacryptus.openai.OpenAIClient$moderate$1.invoke(OpenAIClient.kt:427)
	at com.simiacryptus.openai.HttpClientManager.runAsync$lambda$7(HttpClientManager.kt:158)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	... 1 more
Caused by: java.io.IOException: Incorrect API key provided: 0P0BhJ6V************************************nOsj. You can find your API key at https://platform.openai.com/account/api-keys.
	... 12 more

Incorrect API key provided
You will need to go into your settings and edit the api key in the tool configuration. I can say the format you have doesn't look right. Mine all begin with 'sk-'

This should have dedicated error handling, though.

Improved error handling to handle bad keys has been added to 1.2.9 which should be out tomorrow.