Skip to content

"filter not found" in Web3.py 4.2.0 #923

Closed
@alex-murashkin

Description

@alex-murashkin
  • Version: 4.2.0
  • Python: 3.6.4
  • OS: osx

What was wrong?

"Filter not found" exception was unexpectedly thrown in about 45 mins after the filter was created.

Please include any of the following that are applicable:

  • The code which produced the error

Anonymized code:


self.__my_contract = self.web3_client.eth.contract(
                address=self.my_contract_address,
                abi=abi_json,
            )
...

self.__run_audit_evt_thread(
            "MyGreatEvent",
            self.__my_contract.events.MyGreatEvent.createFilter(fromBlock=start_block),
            self.__on_my_great_event,
        )
  • The full output of the error
Exception in thread MyGreatEvent thread:
Traceback (most recent call last):
  File "/Users/myusername/.pyenv/versions/3.6.4/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/myusername/.pyenv/versions/3.6.4/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/myusername/projects/myproject/main_file.py", line 67, in exec
    for evt in evt_filter.get_new_entries():
  File "/Users/myusername/.pyenv/versions/3.6.4/lib/python3.6/site-packages/web3/utils/filters.py", line 105, in get_new_entries
    log_entries = self._filter_valid_entries(self.web3.eth.getFilterChanges(self.filter_id))
  File "/Users/myusername/.pyenv/versions/3.6.4/lib/python3.6/site-packages/web3/eth.py", line 320, in getFilterChanges
    "eth_getFilterChanges", [filter_id],
  File "/Users/myusername/.pyenv/versions/3.6.4/lib/python3.6/site-packages/web3/manager.py", line 106, in request_blocking
    raise ValueError(response["error"])
ValueError: {'code': -32000, 'message': 'filter not found'}
  • What type of node you were connecting to.
    Geth/v1.8.6-stable-12683fec/linux-amd64/go1.10

How can it be fixed?

I don't have any concrete suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions