-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Docker results in 502 Bad Gateway #26
Comments
@jimmysong I tried to reproduce locally but I couldn't reproduce, going to the endpoint works for me - if you are using liquid or testnet you have to add before api the environment, for example for liquid http://localhost:8082/liquid/api/blocks/:1 If not, could you provide the steps you tried? |
I've tried both mainnet and testnet (ports 8080 and 8081 respectively. The api urls all give a 502 Bad Gateway from docker. Example: http://localhost:8080/api/blocks/:1 Here's the logging data from the docker container. I have another one for mainnet esplora, which looks similar.
|
I'm experiencing the same issue. Followed the README but getting a 502 bad gateway on every endpoint. |
@jimmysong How long have you waited for and what is the spec of the box? The docker images synchronizes from scratch and isn't particularly tuned to do so fast (for example no dbcache etc) - once bitcoin core synchronizes then electrs should kick in for a few hours and then open up the port and nginx should be able to respond correctly. Can you tail debug.log from the data_dir bitcoin directory and electrs-liquid.log from the logs directory? You should be able to do this either from outside docker or from within by doing docker ps
docker exec -it $HASH_OF_INSTANCE_FROM_PS bash and then tail -f /data/bitcoin/debug.log for mainnet or /data/bitcoin/testnet3/debug.log for testnet once you are inside the docker image there's also cli shell script for bitcoin-cli shorthand preparametrized (https://github.com/Blockstream/esplora/blob/master/cli.sh.in) |
I've had esplora running for over a week and it was synced in about 6-7 hours.
|
ok, a little update. It might be because I'm running esplora and esplora-testnet on the same server. testnet is now working fine, but esplora still has the same error. I think something is wrong with the monitoring port 4224. Maybe they conflict somehow? |
@jimmysong as far as I know docker shouldn't conflict if you use the same ports as long as you don't export them with -p - in any case from the logs you provided it seems that electrs had some issues, not sure why. To increase logging verbosity you may want to try to add -vvv (say before --timestamp) to
and then rebuild the docker images. Alternatively you can try stopping, deleting electrs_mainnet_db and restart the instance |
Hi, I fixed this problem on my end, after hunting through logs the issue was not enough HDD space on my device.
Increasing HDD capacity and deleting the database directory then re-syncing worked. |
Looks like the blocks weren't synced or something, my issue has gone away as well. Running both on the same docker server. |
@jimmysong thanks! closing |
I'm running in the same issue and it looks like that paths of log files have changed since this was first posted? bitcoind seems to be all finished and working:
but when I look into this folder: and when I look into this folder:
This has been running on my small server (dual core, 4gb ram) for more than a week and is still showing "Esplora is currently unavailable, please try again later.", I've also spun up another instance with 8 cores and 32gb ram, which has been running for 24 hours and is still showing the same. Do you have any idea how long this indexing takes? Also, do you think it's possible to copy the data directory from the fast server to the slow server (IF that one ever starts to work) and would it work? Or each instance needs to do their own indexing? Any help would be much appreciated @greenaddress :) |
Same question! I have the same error in log. |
I am having the same issue. UI is saying "Esplora is currently unavailable, please try again later" and api returning "502 Bad Gateway", and also error logs is same as upper comment. |
You can get electrs to print more verbose output by starting the docker One possible guess for why your servers aren't starting (or rather, taking a really long time to) is that they're still busy computing the cached stats for the "popular addresses", which can take a lot of time, especially on weaker machines. We recently updated the list of popular addresses, which might explain why it stopped working after pulling a newer version. You should be able to confirm this is the cause once you set a higher verbosity level. If that's indeed the case, then it should be totally fine to turn off the pre-caching for personal use. You can do this by removing |
Ah, there's actually an easier way to disable precaching that doesn't require building the image - mount an empty into
Definitely not ideal either, I will add a simpler option to turn this off with an environment variable. |
619ff48 added support for setting |
So, what is the fix? I still running into error HTTP 502 and not sure what to do. Increasing verbosity only results in too many unreadable logs like |
@demian85 Can you share some more of your logs? (making sure to remove any sensitive information) |
Running the docker command per the README.md. The result is a page with a 502 Bad Gateway error due to a missing endpoint in /api/blocks/:1 when going to the :8080 web page.
The text was updated successfully, but these errors were encountered: