0.28 binds to default ports when -port or -rpcport set #31372

issue dpc openend this issue on November 25, 2024
  1. dpc commented at 9:23 pm on November 25, 2024: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    0bitcoind --datadir=(mktemp -d) -port=51234 -rpcport=51235
    

    fails for me with:

    02024-11-25T21:18:29Z [net:error] Unable to bind to 127.0.0.1:8334 on this computer. Bitcoin Core is probably already running.
    12024-11-25T21:18:29Z [error] Unable to bind to 127.0.0.1:8334 on this computer. Bitcoin Core is probably already running.
    2Error: Unable to bind to 127.0.0.1:8334 on this computer. Bitcoin Core is probably already running.
    32024-11-25T21:18:29Z [error] Failed to listen on any port. Use -listen=0 if you want this.
    4Error: Failed to listen on any port. Use -listen=0 if you want this.
    

    (because I already have one listening)

    This was not the case in 0.27. I noticed when upgrading nixpkgs in our test suite (which switches bitcoind from 0.27 to 0.28). We used to set port and rpcport in the config and that was it. Now we need to set also bind and rpcbind.

    Expected behaviour

    Unclear if this is a bug, but clearly a change in the behavior, so worth reporting.

    Steps to reproduce

    0bitcoind --datadir=(mktemp -d) -port=51234 -rpcport=51235
    

    , check ports with sudo netstat -l -p -n | grep bitcoind

    Relevant log output

    No response

    How did you obtain Bitcoin Core

    Package manager

    What version of Bitcoin Core are you using?

    v28.0.0

    Operating system and version

    NixOS 24.11-beta

    Machine specifications

    No response

  2. mzumsande commented at 9:39 pm on November 25, 2024: contributor
    Thanks for the report - this is known, see #31133 . An immediate fix is to use -bind instead of -port, as you mentioned. It is still being discussed whether and how this should be fixed, see the linked issue and #31223.
  3. dpc commented at 9:41 pm on November 25, 2024: none
    Thanks. Closing, since a dup.
  4. dpc closed this on Nov 25, 2024


dpc mzumsande


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: 2024-12-26 12:12 UTC

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