web3j icon indicating copy to clipboard operation
web3j copied to clipboard

Filter Exception, Invalid request: filter not found

Open 0xPuddi opened this issue 2 years ago • 1 comments

Filter Exception, Invalid request: filter not found

I'm using a custom contract customEventFlowable(filter).subscribe(()->{...}) to filter through that event, the filter is created by:

EthFilter eFilter = new EthFilter(DefaultBlockParameterName.LATEST, DefaultBlockParameterName.LATEST, contractAddress);
eFilter.addSingleTopic(EventEncoder.encode(Contract.CUSTOM_EVENT));

The odd thing is that I run it multiple times and once it went through without error. I have no idea how to solve it, as the event is being added to the event filter.

Environment

Describe the environment in which the issue occurs

  • Web3j 4.9.8
  • Java 17.0.9
  • Operating System, MacOS M2

Additional context

Stacktrace:

org.web3j.protocol.core.filters.FilterException: Invalid request: filter not found
        at org.web3j.protocol.core.filters.Filter.throwException(Filter.java:200)
        at org.web3j.protocol.core.filters.Filter.getInitialFilterLogs(Filter.java:123)
        at org.web3j.protocol.core.filters.Filter.run(Filter.java:72)
        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 io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual(FlowableCreate.java:71)
        at io.reactivex.Flowable.subscribe(Flowable.java:14479)
        at io.reactivex.internal.operators.flowable.FlowableMap.subscribeActual(FlowableMap.java:37)
        at io.reactivex.Flowable.subscribe(Flowable.java:14479)
        at io.reactivex.Flowable.subscribe(Flowable.java:14416)
        at io.reactivex.Flowable.subscribe(Flowable.java:14337)

0xPuddi avatar Jan 06 '24 10:01 0xPuddi

Were you able to find a solution for this?

dev-wasabi avatar Nov 18 '24 18:11 dev-wasabi