'ERROR: Error reading proxy response' when using TOR on bitcoind #9430

issue ghost opened this issue on December 26, 2016
  1. ghost commented at 12:19 PM on December 26, 2016: none

    Describe the issue

    The problem is, the error message: 'ERROR: Error reading proxy response' in the debug.log file. I wanted to simply run bitcoin over TOR. So in the bitcoin.conf file i had the following lines: bind=127.0.0.1 port=8333 upnp=0 proxy=127.0.0.1:9050

    Then i started bitcoind in terminal, i monitored the debug.log file and i saw that error message described above every minute or so while i was getting a new 'update tip' block.

    To test if TOR was really working, i stopped the TOR service and i immediately got countless errors: connect() to 127.0.0.1:9050 failed after select(): Connection refused (111) connect() to 127.0.0.1:9050 failed after select(): Connection refused (111) connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)

    So i realized that TOR was working, yet the original unknown error of: 'ERROR: Error reading proxy response' occurred.

    Please note: my intention was not to use a hidden tor service. My intention was to simply torify outgoing connections as described in the first step here: https://github.com/bitcoin/bitcoin/blob/master/doc/tor.md#1-run-bitcoin-behind-a-tor-proxy and here: https://bitcointalk.org/index.php?topic=623868.0

    Expected behaviour

    The expected behaviour should have been that bitcoin would run over tor without a proxy error while tor is actually working.

    What version of bitcoin-core are you using?

    sudo apt-add-repository ppa:bitcoin/bitcoin (https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin) sudo apt-get install bitcoind

    Machine specs:

    • OS: Ubuntu 16.04
    • Disk Type (HD/SDD): SSD

    If there should be some other type of config that i am missing in bitcoin.conf please let me know.

  2. fanquake added the label Linux/Unix on Dec 26, 2016
  3. unsystemizer commented at 6:56 PM on December 27, 2016: contributor

    You need to fix your proxy. Unless you can show other apps work with that proxy and Bitcoin does not, it's not a Bitcoin issue. Similar eample: https://github.com/bitcoin-dot-org/bitcoin.org/issues/1334 Perhaps you should fix Tor first and make sure that it works as SOCKS5 proxy. At the moment you only demonstrate that the proxy is refusing connections, and not that Bitcoin is not functioning properly

  4. ghost commented at 7:07 PM on December 27, 2016: none

    Well the thing is, i do use the TOR daemon for other apps and it works perfectly in Ubuntu. Thats why I am reporting this issue. Can you please try and reproduce the issue?

    I can try reproduce the issue on a newly installed Ubuntu 16.04 with TOR installed and report back.

  5. unsystemizer commented at 4:10 AM on December 28, 2016: contributor

    Are those other apps using Tor SOCKS5 proxy? I had Bitcoin 0.12.1 running with Tor on Ubuntu 16.04 before and I had to fix my proxy settings on Tor to get it to work.

    Provide your Tor version and complete configuration files for Bitcoin and Tor - or better yet, get help on Tor forums.

  6. laanwj commented at 11:19 AM on January 2, 2017: member

    If you get a message about connection refused, you have set the wrong port for your proxy. What port is tor really listening on? Never mind, you get that after quitting tor, which makes sense.

  7. ghost commented at 2:12 PM on January 2, 2017: none

    @unsystemizer as far i know, the default TOR daemon installation does not require any configuration for simple outgoing connections to applications that support TOR.

    I have tested this on a fresh installation of Ubuntu 16.04. installed tor and bitcoind. as soon as i created the bitcoin.conf file and started bitcoind, initially i get exactly 2 error messages: 2017-01-02 ERROR: Error reading proxy response 2017-01-02 ERROR: Error reading proxy response

    then all the update tips started downloading perfectly. But again i mention, if i stop the tor service, and start bitcoind - it will flood the log with connect() to 127.0.0.1:9050 failed after select(): Connection refused (111)

    so my daemon IS working. because i can still use it with other apps such as torbirdy for example and there are no issues.

    the fact that bitcoind works while TOR is running while receiving 2 random errors 'Error reading proxy response' and then continuing normally doesnt mean there is something wrong with tor. dont you think? but if the service is stopped i can understand the flood of error messages.

    If you had to run a fresh VM of ubuntu and installed TOR and bitcoind, you will see for yourself. because i just reproduced the issue. Id really appreciate it if you could reproduce the issue so you can see my exact problem.

    the bitcoin.conf file that i create like i said, has the following lines:

    bind=127.0.0.1 port=8333 upnp=0 proxy=127.0.0.1:9050

  8. ghost commented at 2:14 PM on January 2, 2017: none

    is the bitcoin.conf contents correct? the bind address and port is all right i suppose?

  9. sipa commented at 2:17 PM on January 2, 2017: member

    What port are those other installations using? Not all Tor setups use port 9050 by default.

  10. ghost commented at 2:30 PM on January 2, 2017: none

    They using 9050, which is used for the TOR daemon. 9150 is used when using tor browser bundle. thats about it. I just tested now bitcoin.conf to use proxy=127.0.0.1:3050.. just to see the result in the debug.log. and it throws the error: connect() to 127.0.0.1:3050 failed after select(): Connection refused (111)

    so the port 9050 is not incorrect because if it was, it would throw the above error. The fact that this error is thrown a couple times in the beginning: ERROR: Error reading proxy response but then continues normally, confuses me and makes me wonder, IS IT reading the proxy, is it half reading it or what is going on?

  11. ghost commented at 4:03 PM on January 2, 2017: none

    When i get this in debug.log: receive version message: /Satoshi:0.13.1/: version 70014, blocks=446280, us=xx.xx.xx.xx:50597, peer=8 Without TOR, the us=xx.xx.xx.xx would show my original IP address, yet if i start bitcoind with TOR, then the us=xx.xx.xx.xx part would show foreign IP addresses. so TOR does work it seems, but the only question is, why is this error found seldomly within the log while downloading blocks? ERROR: Error reading proxy response

  12. unsystemizer commented at 4:28 PM on January 2, 2017: contributor

    the original unknown error of: 'ERROR: Error reading proxy response' occurred.

    It's neither original nor unknown. In the first comment yesterday I gave you a link to the exact same issue and there the maintainers suggested it's a Tor configuration problem.

    so the port 9050 is not incorrect because if it was, it would throw the above error.

    That does not show your Tor SOCKS5 is properly configured and available for use. I told you yesterday: you fail to show that your Tor SOCKS5 proxy is usable without restrictions to any other client that uses the same settings as bitcoind.

    I'm running 0.13 with Tor SOCKS5 proxy (Tor alpha channel) right now, no issues.

  13. laanwj commented at 9:36 AM on January 26, 2017: member

    so the port 9050 is not incorrect because if it was, it would throw the above error.

    Tor opens more ports than a proxy port (ControlPort, TransPort, DNSPort, to name a few, Tor bundles open a HTTP proxy as well). If you were to use the wrong port as SOCKS5 proxy, you'd get unexpected responses just like here.

    There are many users of Bitcoin Core + Tor so everything suggests a local configuration issue on your end.

  14. laanwj commented at 8:14 AM on February 9, 2017: member

    Looks like we've been chasing ghosts here. That error message "ERROR: Error reading proxy response" is also thrown when the connection attempt times out. This is incredibly common on Tor, especially when connecting to hidden services. Fixed in #9726.

  15. laanwj closed this on Feb 9, 2017

  16. ghost commented at 9:14 AM on February 9, 2017: none

    @laanwj thank you for getting to the bottom of this.

  17. 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