coze-dev / coze-dev/coze-java

无网状态下,SDK初始化时会抛出异常,应用捕获不到

Aperta
#140 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
214
Fork
98
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

java.net.SocketTimeoutException: failed to connect to api.coze.cn/221.8.93.168 (port 443) from /10.245.3.40 (port 38488) after 5000ms
at libcore.io.IoBridge.connectErrno(IoBridge.java:236)
at libcore.io.IoBridge.connect(IoBridge.java:180)
at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
at java.net.Socket.connect(Socket.java:621)
at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:1)
at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:9)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:16)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:38)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:1)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:7)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:7)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:2)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:12)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:27)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:12)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:22)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:12)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:7)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:12)
at com.coze.openapi.service.utils.UserAgentInterceptor.intercept(UserAgentInterceptor.java:6)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:12)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:16)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:5)
at retrofit2.OkHttpCall.execute(OkHttpCall.java:8)
at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:5)
at io.reactivex.Observable.subscribe(Observable.java:14)
at io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:1)
at io.reactivex.Single.subscribe(Single.java:13)
at io.reactivex.Single.blockingGet(Single.java:2)
at com.coze.openapi.service.auth.OAuthClient.execute(OAuthClient.java:1)
at com.coze.openapi.service.auth.OAuthClient.getAccessToken(OAuthClient.java:5)
at com.coze.openapi.service.auth.JWTOAuthClient.doGetAccessToken(JWTOAuthClient.java:25)
at com.coze.openapi.service.auth.JWTOAuthClient.getAccessToken(JWTOAuthClient.java:13)
at com.coze.openapi.service.auth.JWTOAuth.token(JWTOAuth.java:11)
at com.coze.openapi.service.service.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:5)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:12)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:16)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the SDK initialization while offline and trace the call path from AuthenticationInterceptor through JWTOAuth, JWTOAuthClient, and OAuthClient.getAccessToken. Check how the SocketTimeoutException from the OkHttp and RxJava chain propagates during initialization; done means the application can receive and handle the offline failure instead of an uncaught exception.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
api, authentication
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.