Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

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

Open
mahermeg17 opened this issue Mar 23, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@mahermeg17
Copy link

mahermeg17 commented Mar 23, 2022

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?

  • Docker version: 20.10.12
  • Docker-compose version: 1.26.0

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 mahermeg17 added the bug Something isn't working label Mar 23, 2022
@mahermeg17
Copy link
Author

[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
Copy link
Contributor

Can you try and change this line

sed -i 's/"apiEndpoint": \("\).*\("\)/"apiEndpoint": \1http:\/\/localhost:4000\2/g' ./config/webapp.config.local.json

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants