web3j
web3j copied to clipboard
Ethereum exception org.web3j.protocol.core.filters.Filter : Error sending request
Issue_title
Ethereum subscribe throws exception
Issue_description
I am subscribing to the token with parameter start block and end block. I am creating a cron job for each token at the runtime. I have 10 tokens in my application. I built this approach to run each token separately but when more than one token runs at the same time. I am getting the below exception,
2020-05-12 18:00:21.369 ERROR 16194 --- [pool-3-thread-2] org.web3j.protocol.core.filters.Filter : Error sending request
org.web3j.protocol.core.filters.FilterException: Invalid request: filter not found at org.web3j.protocol.core.filters.Filter.throwException(Filter.java:152) ~[core-3.4.0.jar:na] at org.web3j.protocol.core.filters.Filter.pollFilter(Filter.java:113) ~[core-3.4.0.jar:na] at org.web3j.protocol.core.filters.Filter.lambda$run$0(Filter.java:75) ~[core-3.4.0.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_231] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[na:1.8.0_231] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_231] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[na:1.8.0_231] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_231] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_231] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_231]
I faced the same issue,who knows how to solve it?
My error info is below: 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)
so this simple bug still wasn't fixed???
same problem
my version is 4.8.7
ERROR o.w.p.c.f.Filter - [lambda$run$0,97] - Error sending request 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.run(Filter.java:104) at org.web3j.protocol.core.filters.Filter.reinstallFilter(Filter.java:155) at org.web3j.protocol.core.filters.Filter.pollFilter(Filter.java:137) at org.web3j.protocol.core.filters.Filter.lambda$run$0(Filter.java:92) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.InterruptedIOException: interrupted at okio.Timeout.throwIfReached(Timeout.kt:98) at okio.OutputStreamSink.write(JvmOkio.kt:50) at okio.AsyncTimeout$sink$1.write(AsyncTimeout.kt:103) at okio.RealBufferedSink.flush(RealBufferedSink.kt:267) at okhttp3.internal.http1.Http1ExchangeCodec.finishRequest(Http1ExchangeCodec.kt:155) at okhttp3.internal.connection.Exchange.finishRequest(Exchange.kt:91) at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:76) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) 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.execute(RealCall.kt:154) at org.web3j.protocol.http.HttpService.performIO(HttpService.java:165) at org.web3j.protocol.Service.send(Service.java:48) at org.web3j.protocol.core.Request.send(Request.java:87) at org.web3j.protocol.core.filters.LogFilter.sendRequest(LogFilter.java:41) at org.web3j.protocol.core.filters.Filter.run(Filter.java:59)
This problem also occurs when version 4.8.8 has been running for some time, causing it to stop listening for contract events
Would be nice if there is a method to retry upon error.