polkascan / explorer

Polkascan Substrate Explorer
GNU General Public License v3.0
42 stars 44 forks source link

harvester_1 | socket.gaierror: [Errno -2] Name or service not known #4

Closed Ethereumx closed 1 year ago

Ethereumx commented 2 years ago

In order to use the explorer with a localsubstrate node I have changed the docker compose to indicate its address :+1: SUBSTRATE_RPC_URL=ws://127.0.0.1:9944 and I've removed the container substrate-node

But after running the explorer I am getting the following error continuously :

harvester_1  | INFO  [alembic.runtime.migration] Context impl MySQLImpl.
harvester_1  | INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
harvester_1  | Traceback (most recent call last):
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/websocket/_http.py", line 155, in _get_addrinfo_list
harvester_1  |     addrinfo_list = socket.getaddrinfo(
harvester_1  |   File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
harvester_1  |     for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
harvester_1  | socket.gaierror: [Errno -2] Name or service not known
harvester_1  | 
harvester_1  | During handling of the above exception, another exception occurred:
harvester_1  | 
harvester_1  | Traceback (most recent call last):
harvester_1  |   File "app/harvester.py", line 385, in <module>
harvester_1  |     harvester = Harvester(
harvester_1  |   File "app/harvester.py", line 71, in __init__
harvester_1  |     self.substrate = SubstrateInterface(
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/substrateinterface/base.py", line 550, in __init__
harvester_1  |     self.connect_websocket()
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/substrateinterface/base.py", line 588, in connect_websocket
harvester_1  |     self.websocket = create_connection(
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/websocket/_core.py", line 605, in create_connection
harvester_1  |     websock.connect(url, **options)
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/websocket/_core.py", line 246, in connect
harvester_1  |     self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/websocket/_http.py", line 122, in connect
harvester_1  |     addrinfo_list, need_tunnel, auth = _get_addrinfo_list(
harvester_1  |   File "/usr/local/lib/python3.8/site-packages/websocket/_http.py", line 167, in _get_addrinfo_list
harvester_1  |     raise WebSocketAddressException(e)
harvester_1  | websocket._exceptions.WebSocketAddressException: [Errno -2] Name or service not known
azexplorer_harvester_1 exited with code 1
arjanz commented 2 years ago

Keep in mind that localhost means the Docker container of the harvester and not the host machine where you probably run the Substrate node. You might want to use host.docker.internal:9944

wouterter commented 1 year ago

This conversation seems to have ended. I'm closing this issue.