iotaledger / one-click-tangle

"One Click Tangle" intends to make lives easier to IOTA adopters by providing pre-configured scripts and recipes that allow to deploy IOTA Networks and Nodes "in one click".
MIT License
55 stars 36 forks source link

The explorer-webapp can't connect to the explorer-api on localhost:4000 #74

Open mahermeg17 opened 2 years ago

mahermeg17 commented 2 years ago

Bug description

The explorer-webapp can't connect to the explorer-api on localhost:4000.

Docker and docker-compose version

Which version of Docker and docker-compose are you running?

Hardware specification

Hetzner CX21

Steps To reproduce the bug

Explain how the maintainer can reproduce the bug.

  1. Having a running Hornet private node
  2. Add explorer : ./tangle-explorer.sh install

Expected behaviour

Seeing tangle info on the explorer web ui.

Actual behaviour

The explorer-webapp can't connect the explorer-api On the explorer web ui get this message : Explorer is currently undergoing maintenance, please check back later. On the navigator console (ctrl+F12) : GET http://localhost:4000/networks net::ERR_BLOCKED_BY_CLIENT

But when using external IP (not localhost) it works!

cheking from the explorer-webapp :

docker container exec -it 40ebbde32e44 sh
/usr/src/app # wget  http://localhost:4000
Connecting to localhost:4000 (127.0.0.1:4000)
wget: can't connect to remote host (127.0.0.1): Connection refused
/usr/src/app # wget  http://node1:4000
Connecting to explorer-api:4000 (172.18.0.5:4000)
saving to 'index.html'
index.html           100% |**************************************************************************|    41  0:00:00 ETA
'index.html' saved
/usr/src/app # wget  http://EXTERNAL_IP:4000
Connecting to EXTERNAL_IP:4000 (EXTERNAL_IP:4000)
saving to 'index.html'
index.html           100% |**************************************************************************|    41  0:00:00 ETA
'index.html' saved

Errors

On the explorer web ui get this message : Explorer is currently undergoing maintenance, please check back later. On the navigator console (ctrl+F12) : GET http://localhost:4000/networks net::ERR_BLOCKED_BY_CLIENT

mahermeg17 commented 2 years ago

[UPDATE] when setting EXTERNAL_IP in config/webapp.config.local.json, like this:

{
  "apiEndpoint": "http://EXTERNAL_IP:4000",
  "googleAnalyticsId": "GOOGLE-ANALYTICS-ID",
  "identityResolverEnabled": true
}

I get some data on the explorer ui. But still having data update issue on tne navigator console

fetchHelper.ts:41          GET http://88.99.32.163:4000/currencies 400 (Bad Request)

websocket.js:138 WebSocket connection to 'ws://88.99.32.163:4000/socket.io/?EIO=4&transport=websocket' failed: WebSocket is closed before the connection is established.

No firewall or network restriction on the server, neither docker settings.

Thank you in advance.

peterokwara commented 2 years ago

Can you try and change this line https://github.com/iotaledger/one-click-tangle/blob/9210fada7fb4cfcf5e846f9fd83cc7b7189d9398/explorer/tangle-explorer.sh#L80

change it from localhost to an ip where the explorer api is located, even if it's on the same server, also the port and see if it works