Unable to use bitcoin-cli on Windows if bitcoin-qt connects through tor #10019

issue AKJ opened this issue on March 17, 2017
  1. AKJ commented at 3:20 AM on March 17, 2017: none

    Describe the issue

    When setting up the gui to connect through tor, bitcoin-cli commands fail to work if accessed through the Windows command prompt with a message about failing to get rpc credentials. This problem does not occur for me once I revert those settings.

    Can you reliably reproduce the issue?

    If so, please list the steps to reproduce below:

    1. Start bitcoin-qt on Windows 7, using a custom data directory.
    2. In settings > network, set proxy and tor checkboxes and connect through 127.0.0.1:9150 for both.
    3. While tor is running and there are active connections to the bitcoin network, attempt any bitcoin-cli command from the command prompt, for example bitcoin-cli help

    Expected behaviour

    Normally this would result in the help text for bitcoin-cli being displayed.

    Actual behaviour

    Instead, I receive this text: error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (C:\Users\user\AppData\Roaming\Bitcoin\bitcoin.conf)

    Setting an rpcpassword value in bitcoin.conf yields: error: couldn't connect to server: EOF reached (code 1) (make sure server is running and you are connecting to the correct RPC port)

    Server is set to 1.

    What version of bitcoin-core are you using?

    0.14.0 official binary

    Any extra information that might be useful in the debugging process.

    If needed I can provide a debug.log; I'm not sure if that would be valuable in this instance. Happy to provide any other information..

  2. AKJ commented at 3:48 AM on March 17, 2017: none

    I have server=1 set in bitcoin.conf

    Additionally, changing from connecting through tor to connecting regularly allows me to run bitcoin-cli commands normally.

    On 3/16/2017 11:40 PM, Pieter Wuille wrote:

    Are you running with -server ?

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/10019#issuecomment-287258964, or mute the thread https://github.com/notifications/unsubscribe-auth/ADc542B18eVnbBZfZSFkN0fXr8qzmspkks5rmgDLgaJpZM4MgIiT.

  3. fanquake added the label Windows on Mar 17, 2017
  4. laanwj added the label RPC/REST/ZMQ on Mar 17, 2017
  5. laanwj commented at 9:02 AM on March 17, 2017: member

    This is strange. In principle, using tor or not should not have any influence on reachability of the RPC port - those subsystems are separate.

    So I think your problem is unrelated to Tor.

    Have you perhaps changed the data directory in the GUI? If you did, you need to specify that to bitcoin-cli using -datadir=<newdatadir>. The console tools will not pick up GUI settings.

  6. AKJ commented at 10:17 PM on September 11, 2017: none

    Okay, that makes sense in principle. I have tried a couple things with confusing results though. I apologize if this is teaching kindergarten, but can you help me understand what I might be doing wrong here?

    Command: %path-to-bitcoin%\daemon\bitcoin-cli.exe -datadir=newdatadir Result: error: too few parameters (need at least command)

    Command: bitcoind.exe -datadir=newdatadir Result: A .cookie file is created (good) but bitcoind seems to hang and I cannot execute any rpc commands (less good).

    Again, apologies if this is easy stuff.

  7. meshcollider commented at 6:43 AM on September 12, 2017: contributor

    @AKJ, bitcoin-cli has to be given a command to run, as a parameter, it isn't like bitcoin-qt which has a GUI or anything, its a command line tool (hence the 'cli'). E.g. bitcoin-cli.exe getbalance

  8. AKJ commented at 9:38 PM on September 14, 2017: none

    Well regardless, if this is an issue with the code (which I doubt now) it certainly isn't the one presented here. Closing.

  9. AKJ closed this on Sep 14, 2017

  10. MarcoFalke locked this on Sep 8, 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