hyperledger-web3j / web3j

Lightweight Java and Android library for integration with Ethereum clients
https://www.web3labs.com/web3j-sdk
Other
5.11k stars 1.69k forks source link

org.web3j.protocol.core.filters.FilterException: Error sending request #1530

Open tmac2yt opened 3 years ago

tmac2yt commented 3 years ago

I faced this issue when I try to listen my contract event on Matic main net,and it's fine when I test at local with Ganache,Matic test net and Rinkeby : 2021/10/ 26-12: 10:15 [restartedMain] DEBUG -1ogger- --> POST https://rpc-mainnet.matic.quiknode.pro/ ""2021/10/ 26-12: 10:15 [restartedMain] DEBUG -1ogger- Content-Type: application/json; charset=utf-8 ""2021/10/ 26-12: 10:15 [restartedMain] DEBUG -1ogger- Content-Length: 242 ""2021/10/ 26-12: 10:15 [restartedMain] DEBUG -1ogger- ""2021/10/ 26-12: 10:15 [restartedMain] DEBUG -1ogger- {"jsonrpc":"2.0","method":"eth_newFilter","params":[{"topics":["0x4a39dc06d4c0dbc64b70af90f"],"fromBlock":"0x12b3b41","toBlock":"latest","address":["0x"]}],"id":4} ""2021/10/ 26-12: 10:15 [restartedMain] DEBUG -1ogger- --> END POST (242-byte body) "org.web3j.protocol.core.filters.FilterException: Error sending request at org.web3j.protocol.core.filters.Filter.throwException(Filter.java:194) at org.web3j.protocol.core.filters.Filter.getInitialFilterLogs(Filter.java:122) at org.web3j.protocol.core.filters.Filter.run(Filter.java:69) at org.web3j.protocol.rx.JsonRpc2_0Rx.run(JsonRpc2_0Rx.java:89) at org.web3j.protocol.rx.JsonRpc2_0Rx.lambda$ethLogFlowable$2(JsonRpc2_0Rx.java:79) at org.web3j.protocol.rx.JsonRpc2_0Rx$$Lambda$572/21239230.subscribe(Unknown Source) at io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:71) at io.reactivex.Flowable.subscribe(Flowable.java:14936) at io.reactivex.Flowable.subscribe(Flowable.java:14873) at io.reactivex.Flowable.subscribe(Flowable.java:14792)

kutasms commented 2 years ago

I also encountered this problem. It seems that the thread crashed and the event monitoring failed org.web3j.protocol.core.filters.FilterException: Error sending request at org.web3j.protocol.core.filters.Filter.throwException(Filter.java:198) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.getInitialFilterLogs(Filter.java:126) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.run(Filter.java:69) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.reinstallFilter(Filter.java:159) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.pollFilter(Filter.java:141) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.lambda$run$0(Filter.java:92) ~[core-4.8.9.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131] Caused by: java.net.SocketTimeoutException: timeout at okio.SocketAsyncTimeout.newTimeoutException(JvmOkio.kt:143) ~[okio-2.8.0.jar:?] at okio.AsyncTimeout.access$newTimeoutException(AsyncTimeout.kt:162) ~[okio-2.8.0.jar:?] at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:335) ~[okio-2.8.0.jar:?] at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:427) ~[okio-2.8.0.jar:?] at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:320) ~[okio-2.8.0.jar:?] at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221) ~[logging-interceptor-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154) ~[okhttp-4.9.0.jar:?] at org.web3j.protocol.http.HttpService.performIO(HttpService.java:165) ~[core-4.8.9.jar:?] at org.web3j.protocol.Service.send(Service.java:48) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.Request.send(Request.java:87) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.getInitialFilterLogs(Filter.java:113) ~[core-4.8.9.jar:?] ... 11 more Caused by: java.net.SocketException: Socket closed at java.net.SocketInputStream.read(SocketInputStream.java:204) ~[?:1.8.0_131] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_131] at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) ~[?:1.8.0_131] at sun.security.ssl.InputRecord.read(InputRecord.java:503) ~[?:1.8.0_131] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973) ~[?:1.8.0_131] at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930) ~[?:1.8.0_131] at sun.security.ssl.AppInputStream.read(AppInputStream.java:105) ~[?:1.8.0_131] at okio.InputStreamSource.read(JvmOkio.kt:90) ~[okio-2.8.0.jar:?] at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:129) ~[okio-2.8.0.jar:?] at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:427) ~[okio-2.8.0.jar:?] at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:320) ~[okio-2.8.0.jar:?] at okhttp3.internal.http1.HeadersReader.readLine(HeadersReader.kt:29) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.kt:178) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:221) ~[logging-interceptor-4.9.0.jar:?] at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) ~[okhttp-4.9.0.jar:?] at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154) ~[okhttp-4.9.0.jar:?] at org.web3j.protocol.http.HttpService.performIO(HttpService.java:165) ~[core-4.8.9.jar:?] at org.web3j.protocol.Service.send(Service.java:48) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.Request.send(Request.java:87) ~[core-4.8.9.jar:?] at org.web3j.protocol.core.filters.Filter.getInitialFilterLogs(Filter.java:113) ~[core-4.8.9.jar:?] ... 11 more