RPC Does not work after upgrading for me #14627

issue tgreco opened this issue on November 1, 2018
  1. tgreco commented at 1:10 AM on November 1, 2018: none

    Ever since I upgraded to the latest version I cannot get bitcoin-cli to run.

    When I try bitcoin-cli -rpcuser=charlie -rpcpassword=rv-aoHugIGt28UvY0888888wpTVXLkXYayymj2VXjE= -rpcport=8332 getblockchaininfo

    I get a response:

    error: Could not connect to the server 127.0.0.1:8332
    Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
    

    I have not changed anything besides download source, compile, replace bitcoind and bitcoin-cli files and that's it. Not sure why this would break all of a sudden.

    My bitcoin.conf file:

    # [core]
    testnet=1
    daemon=1
    maxconnections=10
    
    # [configuration]
    datadir=/mnt/volume-sgp1-02/.bitcoin/
    
    # [wallet]
    keypool=2048
    paytxfee=0.0007
    
    # [RPC]
    server=1
    rpcauth=charlie:b9412eabc19b0d4c6e7285c3d96ff87$a229e83490edf029e006a8a973431c52a98709250403117c2baf0f4f7ebb3bba
    rpcclienttimeout=45
    rpcport=8332
    
    [testnet]
    rpcport=8332
    

    Versions:

    Debian GNU/Linux 9 (stretch)
    Bitcoin Core Daemon version v0.17.0.0-ge1ed37edaedc85b8c3468bd9a726046344036243
    
  2. fanquake added the label RPC/REST/ZMQ on Nov 1, 2018
  3. sipa commented at 1:16 AM on November 1, 2018: member

    The rpcport option needs to be in a testnet section; since 0.17 by default it only applies to mainnet.

    You can either use testnet.rpcport=8332 or

    [testnet]
    rpcport=8332
    
  4. tgreco commented at 1:20 AM on November 1, 2018: none

    The rpcport option needs to be in a testnet section; since 0.17 by default it only applies to mainnet.

    You can either use testnet.rpcport=8332 or

    [testnet]
    rpcport=8332
    

    Where do I find such documentation to know what other options need to be in the test net section?

  5. tgreco commented at 1:22 AM on November 1, 2018: none

    It's in the release notes: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#configuration-sections-for-testnet-and-regtest

    Thank you. To save someone time in the future possibly:

    If the following options are not in a section, they will only apply to mainnet: addnode=, connect=, port=, bind=, rpcport=, rpcbind= and wallet=. The options to choose a network (regtest= and testnet=) must be specified outside of sections.

  6. tgreco closed this on Nov 1, 2018

  7. tgreco commented at 1:33 AM on November 1, 2018: none

    Even with the updated bitcoin.conf file I am still unable to connect via RPC

  8. tgreco reopened this on Nov 1, 2018

  9. achow101 commented at 1:45 AM on November 1, 2018: member

    Are you sure that bitcoind is running? If you do netstat -nlp, do you see bitcoind bound to port 8332?

  10. tgreco commented at 1:50 AM on November 1, 2018: none

    Are you sure that bitcoind is running? If you do netstat -nlp, do you see bitcoind bound to port 8332?

    It is running but it appears to be listening on port 18332 and I have zero clue why since I have my configuration setup to use 8332. Any ideas?

    Proof it's running:

    bitcoin2@MT4:~/.bitcoin$ netstat -nlp
    (Not all processes could be identified, non-owned process info
     will not be shown, you would have to be root to see it all.)
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
    tcp        0      0 127.0.0.1:18332         0.0.0.0:*               LISTEN      28013/bitcoind      
    tcp        0      0 0.0.0.0:18333           0.0.0.0:*               LISTEN      28013/bitcoind      
    tcp6       0      0 :::22                   :::*                    LISTEN      -                   
    tcp6       0      0 ::1:18332               :::*                    LISTEN      28013/bitcoind      
    tcp6       0      0 :::18333                :::*                    LISTEN      28013/bitcoind      
    udp        0      0 10.15.0.6:123           0.0.0.0:*                           -                   
    udp        0      0 209.97.171.251:123      0.0.0.0:*                           -                   
    udp        0      0 127.0.0.1:123           0.0.0.0:*                           -                   
    udp        0      0 0.0.0.0:123             0.0.0.0:*                           -                   
    udp6       0      0 fe80::508b:bdff:fe8:123 :::*                                -                   
    udp6       0      0 ::1:123                 :::*                                -                   
    udp6       0      0 :::123                  :::*                                -                   
    Active UNIX domain sockets (only servers)
    Proto RefCnt Flags       Type       State         I-Node   PID/Program name     Path
    unix  2      [ ACC ]     STREAM     LISTENING     9924     -                    /run/systemd/private
    unix  2      [ ACC ]     STREAM     LISTENING     9930     -                    /run/systemd/journal/stdout
    unix  2      [ ACC ]     STREAM     LISTENING     9943     -                    /run/systemd/fsck.progress
    unix  2      [ ACC ]     SEQPACKET  LISTENING     9960     -                    /run/udev/control
    unix  2      [ ACC ]     STREAM     LISTENING     12533    -                    /var/run/dbus/system_bus_socket
    

    Proof this is the correct process and using the correct conf file:

    bitcoin2@MT4:~/.bitcoin$ ps aux | grep bitcoind
    bitcoin2 28013 67.2 19.6 1710152 794960 ?      Ssl  01:48   0:20 /usr/bin/bitcoind -conf=/home/bitcoin2/.bitcoin/bitcoin.conf
    bitcoin2 28034  0.0  0.0  12720   964 pts/2    S+   01:49   0:00 grep bitcoind
    

    Proof the conf file is correct:

    bitcoin2@MT4:~/.bitcoin$ cat /home/bitcoin2/.bitcoin/bitcoin.conf 
    # [core]
    testnet=1
    daemon=1
    maxconnections=10
    
    # [configuration]
    datadir=/mnt/volume-sgp1-02/.bitcoin/
    
    # [wallet]
    keypool=2048
    paytxfee=0.0007
    
    # [RPC]
    server=1
    rpcauth=charlie:b9412eabc19b0d4c6e7285c3d96ff87$a229e83490edf029e006a8a973431c52a98709250403117c2baf0f4f7ebb3bba
    rpcclienttimeout=45
    rpcport=8332
    
    [testnet]
    rpcport=8332
    
    
  11. sipa commented at 2:02 AM on November 1, 2018: member

    Did you restart bitcoind after updating your configuration file?

  12. tgreco commented at 2:06 AM on November 1, 2018: none

    Did you restart bitcoind after updating your configuration file?

    Yes I did.

  13. AkioNak commented at 2:27 AM on November 1, 2018: contributor

    @tgreco I think section name should be [test] instead of [testnet].

  14. sipa commented at 2:29 AM on November 1, 2018: member

    Oops, my bad!

  15. fanquake commented at 4:42 AM on November 5, 2018: member

    tgreco I think section name should be [test] instead of [testnet]. @tgreco Did this solve your problem? If so, can you close this issue.

  16. MarcoFalke commented at 4:28 PM on November 5, 2018: member

    Shouldn't we warn when the name of the section is not recognized?

  17. fanquake commented at 9:59 AM on November 10, 2018: member

    Thanks, I've opened an issue for that in #14702.

  18. fanquake closed this on Nov 10, 2018

  19. lyhistory commented at 3:11 AM on March 12, 2019: none

    It's in the release notes: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#configuration-sections-for-testnet-and-regtest

    Thank you. To save someone time in the future possibly:

    If the following options are not in a section, they will only apply to mainnet: addnode=, connect=, port=, bind=, rpcport=, rpcbind= and wallet=. The options to choose a network (regtest= and testnet=) must be specified outside of sections.

    really saved my time, I was wondering why regtest rpcport not work, remain default 18443, thanks!

  20. DrahtBot 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-13 15:15 UTC

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