Can't bind rpcport inside docker #16209

issue mrbianchi opened this issue on June 14, 2019
  1. mrbianchi commented at 2:04 AM on June 14, 2019: none

    I dont really know if it is a bitcoin core problem or not , but I'm trying hard and I can't get it

    Binding RPC on address :: port 18332 failed.

    More info: https://github.com/kylemanna/docker-bitcoind/issues/42

  2. mrbianchi commented at 2:29 AM on June 14, 2019: none

    and before :

    libevent: getaddrinfo: address family for nodename not supported

  3. fanquake added the label Questions and Help on Jun 14, 2019
  4. fanquake commented at 6:03 AM on June 14, 2019: member

    @harding might be able to help here?

  5. mrbianchi commented at 3:17 PM on June 14, 2019: none

    Update: With debug=1 I could verify that 127.0.0.0:18332 was being binded, not [::1]:18332 but I dont care I could verify that local connection inside the docker with bitcoin-cli works Now the problem is that I cant use the rpc outside the docker I don't know why Probably isn't a Bitcoin issue

  6. mrbianchi commented at 5:24 PM on June 14, 2019: none

    Update: Confirmed, not bitcoin problem, I tried with another docker image and seems working: https://hub.docker.com/r/ruimarinho/bitcoin-core

  7. mrbianchi closed this on Jun 14, 2019

  8. chanhosuh commented at 7:28 PM on June 15, 2019: none

    @mrbianchi The reason it's working is it's using version 0.16. There was a change in version 0.18 that requires the use of rpcbind parameter.

    Before 0.18, if you put rpcallowip=0.0.0.0/0, the value of rpcbind didn't need to be set as it defaulted to all interfaces.

    Now that is no longer the case. Here's my setup, for running bitcoind in a container through Docker compose:

    rpcallowip=0.0.0.0/0
    rpcbind=127.0.0.1
    rpcbind=<local DNS name, such as the container name used in your Docker Compose file>
    

    The first rpcbind is so I can make RPC calls from inside the container. The second is so other containers can reach the bitcoind container.

  9. mrbianchi commented at 3:49 AM on June 16, 2019: none

    @chanhosuh you are right! I tested. Documentation should be updated. Additionally, I had to add [test] section in file bitcoin.conf because is mandatory for testnet

    server=1
    rpcallowip=0.0.0.0/0
    rpcuser=admin
    rpcpassword=admin
    
    [test]
    rpcbind=127.0.0.1:18332
    rpcbind=172.18.0.30:18332
    
  10. caiyaonan commented at 3:07 AM on July 29, 2019: none

    Binding RPC on address xxx.xxx.xxx.xxx port 19914 failed.

  11. caiyaonan commented at 3:09 AM on July 29, 2019: none

    i write rpcport rpcallowip rpcallowip rpcbind, but system print error Binding RPC on address 116.21.17.197 port 19914 failed. @chanhosuh @mrbianchi help

  12. abhyankar-amey commented at 6:54 AM on November 20, 2019: none

    Update: Confirmed, not bitcoin problem, I tried with another docker image and seems working: https://hub.docker.com/r/ruimarinho/bitcoin-core @mrbianchi I am trying from a while with 0.18.1 bitcoin-core version but RPC not working. My commands =

    1. Start docker conainer = docker run --rm --name bitcoin-server -it btc-19nov
      -printtoconsole
      -regtest=1
      -rpcbind=127.0.0.1
      -rpcauth=

    2. Initiate RCP call from base Ubuntu 18.04 LTS machine = docker run -it --rm btc-19nov
      bitcoin-cli
      -rpcconnect=bitcoin-server
      -regtest
      -rpcuser=amey
      -stdinrpcpass
      getbalance

    Error = error: Could not connect to the server bitcoin-server:18443

    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

    Any hints how to solve this issue?

    I am using = Docker version 19.03.4, build 9013bf583a Base OS = Ubuntu 18.04 LTS

    If I telnet to localhost using the bind port, I get message connection refused. For other docker app if I telnet on different port, it works!

  13. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me