You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include any of the following that are applicable:
The code which produced the error
Make this call via web3.py
curl -s --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xb2fea9c4b24775af6990237aa90228e5e092c56bdaee74496992a53c208da1ee"],"id":"1"}' -H "Content-Type: application/json" -X POST https://nodes.mewapi.io/rpc/eth
The full output of the error
[28/04/2022 17:43:22 CEST] DEBUG web3.providers.HTTPProvider Getting response HTTP. URI: https://nodes.mewapi.io/rpc/eth, Method: eth_getTransactionByHash, Response: {'jsonrpc': '2.0', 'id': 42, 'error': {'code': -32601, 'message': 'the method eth_getTransactionByHash does not exist/is not available'}}
[28/04/2022 17:43:22 CEST] ERROR rotkehlchen.greenlets Greenlet with id 140152317009056: Query ethereum transactions for 0x9ba961989Dd6609Ed091f512bE947118c40F2291 died with exception: {'code': -32601, 'message': 'the method eth_getTransactionByHash does not exist/is not available'}.
Exception Name: <class 'ValueError'>
Exception Info: {'code': -32601, 'message': 'the method eth_getTransactionByHash does not exist/is not available'}
Traceback:
File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
File "/home/yabirgb/work/rotkib/rotkehlchen/chain/ethereum/transactions.py", line 87, in single_address_query_transactions
self._get_erc20_transfers_for_ranges(address=address, ranges_to_query=ranges_to_query)
File "/home/yabirgb/work/rotkib/rotkehlchen/chain/ethereum/transactions.py", line 223, in _get_erc20_transfers_for_ranges
transaction = self.ethereum.get_transaction_by_hash(tx_hash_bytes)
File "/home/yabirgb/work/rotkib/rotkehlchen/chain/ethereum/manager.py", line 933, in get_transaction_by_hash
return self.query(
File "/home/yabirgb/work/rotkib/rotkehlchen/chain/ethereum/manager.py", line 444, in query
result = method(web3, **kwargs)
File "/home/yabirgb/work/rotkib/rotkehlchen/chain/ethereum/manager.py", line 917, in _get_transaction_by_hash
tx_data = web3.eth.get_transaction(tx_hash) # type: ignore
File "/home/yabirgb/work/rotkib/.venv/lib/python3.9/site-packages/web3/eth.py", line 724, in get_transaction
return self._get_transaction(transaction_hash)
File "/home/yabirgb/work/rotkib/.venv/lib/python3.9/site-packages/web3/module.py", line 57, in caller
result = w3.manager.request_blocking(method_str,
File "/home/yabirgb/work/rotkib/.venv/lib/python3.9/site-packages/web3/manager.py", line 198, in request_blocking
return self.formatted_response(response,
File "/home/yabirgb/work/rotkib/.venv/lib/python3.9/site-packages/web3/manager.py", line 171, in formatted_response
raise ValueError(response["error"])
What type of node you were connecting to.
https://nodes.mewapi.io/rpc/eth
How can it be fixed?
I think it would be much better if we, the users of web3, have a different exception to catch when a method is not available in the node, rather than raising a generic ValueError.
How about MethodUnavailable ?
The text was updated successfully, but these errors were encountered:
LefterisJP
added a commit
to LefterisJP/rotkehlchen
that referenced
this issue
Apr 28, 2022
I like this idea but we'll have to think about how to parse the error response to accommodate the most users. I can't remember if error code numbers are standardized across clients. I'll add this to our v6 breaking changes issue to discuss with the team. Eventually in v6 we're also planning on adding a Web3Exception class that all of our custom exceptions will inherit from which should make things nicer too.
Eventually in v6 we're also planning on adding a Web3Exception class that all of our custom exceptions will inherit from which should make things nicer too.
Understood! That would be a really cool change.
Will be looking at the issue to see how it progresses ❤️
pip freeze
outputWhat was wrong?
Please include any of the following that are applicable:
Make this call via web3.py
https://nodes.mewapi.io/rpc/eth
How can it be fixed?
I think it would be much better if we, the users of web3, have a different exception to catch when a method is not available in the node, rather than raising a generic
ValueError
.How about
MethodUnavailable
?The text was updated successfully, but these errors were encountered: