Repository: rotki/rotki

Issue:
Improve user message when none of the nodes could be queried
## Abstract

When you have temporary connectivity issues sometimes tasks will fail after trying to reach all the nodes. The failure message looks like this:

```
Update ilk cache died with exception: Failed to query <bound method EvmNodeInquirer._call_contract of <rotkehlchen.chain.ethereum.node_inquirer.EthereumInquirer object at 0x11193fd00>> after trying the following nodes: ["WeightedNode(node_info=NodeName(name='etherscan', endpoint='', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=1)", "WeightedNode(node_info=NodeName(name='ankr', endpoint='https://rpc.ankr.com/eth', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=5)", "WeightedNode(node_info=NodeName(name='LlamaNodes', endpoint='https://eth.llamarpc.com', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=3)", "WeightedNode(node_info=NodeName(name='myetherwallet', endpoint='https://nodes.mewapi.io/rpc/eth', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.1), identifier=6)", "WeightedNode(node_info=NodeName(name='flashbots', endpoint='https://rpc.flashbots.net/', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.1), identifier=4)", "WeightedNode(node_info=NodeName(name='cloudflare', endpoint='https://cloudflare-eth.com/', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=2)"]. Check logs for details.. Check the logs for more details
```

We should make it so that in this case a more user-friendly message is passed to the user while still pointing them to the logs for more information.


## Motivation

Make sure that the user sees a message that is easy to understand

## Specification

- Add a user friendly message while logging more in detail
Improve user message when none of the nodes could be queried
## Abstract

When you have temporary connectivity issues sometimes tasks will fail after trying to reach all the nodes. The failure message looks like this:

```
Update ilk cache died with exception: Failed to query <bound method EvmNodeInquirer._call_contract of <rotkehlchen.chain.ethereum.node_inquirer.EthereumInquirer object at 0x11193fd00>> after trying the following nodes: ["WeightedNode(node_info=NodeName(name='etherscan', endpoint='', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=1)", "WeightedNode(node_info=NodeName(name='ankr', endpoint='https://rpc.ankr.com/eth', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=5)", "WeightedNode(node_info=NodeName(name='LlamaNodes', endpoint='https://eth.llamarpc.com', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=3)", "WeightedNode(node_info=NodeName(name='myetherwallet', endpoint='https://nodes.mewapi.io/rpc/eth', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.1), identifier=6)", "WeightedNode(node_info=NodeName(name='flashbots', endpoint='https://rpc.flashbots.net/', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.1), identifier=4)", "WeightedNode(node_info=NodeName(name='cloudflare', endpoint='https://cloudflare-eth.com/', owned=False, blockchain=<SupportedBlockchain.ETHEREUM: 'ETH'>), active=True, weight=FVal(0.2), identifier=2)"]. Check logs for details.. Check the logs for more details
```

We should make it so that in this case a more user-friendly message is passed to the user while still pointing them to the logs for more information.


## Motivation

Make sure that the user sees a message that is easy to understand

## Specification

- Add a user friendly message while logging more in detail


Discussion:

Resolving patch:
diff --git a/rotkehlchen/chain/evm/node_inquirer.py b/rotkehlchen/chain/evm/node_inquirer.py
--- a/rotkehlchen/chain/evm/node_inquirer.py
+++ b/rotkehlchen/chain/evm/node_inquirer.py
@@ -538,9 +538,12 @@ def _query(self, method: Callable, call_order: Sequence[WeightedNode], **kwargs:
             return result
 
         # no node in the call order list was succesfully queried
-        raise RemoteError(
+        log.error(
             f'Failed to query {method!s} after trying the following '
-            f'nodes: {[str(x) for x in call_order]}. Check logs for details.',
+            f'nodes: {[x.node_info.name for x in call_order]}',
+        )
+        raise RemoteError(
+            f'Please check your network and confirm sufficient nodes are connected for {self.blockchain!s}.',  # noqa: E501
         )
 
     def _get_latest_block_number(self, web3: Optional[Web3]) -> int:


Test patch: