carlrobertoh / CodeGPT

The leading open-source AI copilot for JetBrains. Connect to any model in any environment, and customize your coding experience in any way you like.
https://codegpt.ee
Apache License 2.0
1.01k stars 213 forks source link

Failed authenticate with proxy #586

Open sboriskin287 opened 4 months ago

sboriskin287 commented 4 months ago

What happened?

I getting error "Failed authenticate with proxy" upon using api.openai.com via proxy. Judging by capturing from wireshark there is no Authentication header with credentials for proxy. Also i attaching idea log.

Relevant log output or stack trace

2024-05-30 14:40:10,535 [1139483]   FINE - #c.i.u.p.CommonProxy - CommonProxy.select called for socket://<proxy-ip-and-port>
2024-05-30 14:40:10,536 [1139484]   FINE - #c.i.u.p.CommonProxy - CommonProxy.select returns custom proxy for socket://<proxy-ip-and-port>, [DIRECT]
2024-05-30 14:40:10,566 [1139514]   WARN - #c.i.s.ComponentManagerImpl - ee.carlrobert.codegpt.telemetry.ui.TelemetryNotifications <clinit> requests com.intellij.ide.plugins.PluginUtil instance. Class initialization must not depend on services. Consider using instance of the service on-demand instead.
2024-05-30 14:40:10,682 [1139630] SEVERE - #ee.carlrobert.codegpt.toolwindow.chat.ToolWindowCompletionResponseEventListener - Failed to authenticate with proxy
java.io.IOException: Failed to authenticate with proxy
    at okhttp3.internal.connection.RealConnection.createTunnel(RealConnection.kt:476)
    at okhttp3.internal.connection.RealConnection.connectTunnel(RealConnection.kt:262)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:201)
    at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
    at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
    at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
    at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517)
    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:840)

Steps to reproduce

  1. Setup http proxy in idea
  2. Send any query to openai api from plugin
  3. Get a error

wireshark-tracing

CodeGPT version

2.7.1

Operating System

Windows

sisve commented 3 months ago

The CONNECT verb, and the Proxy-Connection: Keep-Alive, indicate that you're trying to connect to api.openai.com via an http-proxy, which is also configured to be api.openai.com.

This makes me think that your proxy configuration is wrong. Could you verify that your proxy details are entered correctly? Have you erroneously entered api.openai.com as your proxy server?

sboriskin287 commented 2 months ago

image No, it's my own proxy server, and i setting exactly it in my IDEa settings