Add onion failed; error code 513 #21147

issue ghost opened this issue on February 10, 2021
  1. ghost commented at 11:35 PM on February 10, 2021: none

    Add onion failed; error code 513

    Details mentioned in debug.log:

    2021-02-10T20:01:58Z tor: Successfully connected!
    2021-02-10T20:01:58Z tor: Connected to Tor version 0.3.2.10
    2021-02-10T20:01:58Z tor: Supported authentication method: COOKIE
    2021-02-10T20:01:58Z tor: Supported authentication method: HASHEDPASSWORD
    2021-02-10T20:01:58Z tor: Supported authentication method: SAFECOOKIE
    2021-02-10T20:01:58Z tor: Using SAFECOOKIE authentication, reading cookie authentication from /var/run/tor/control.authcookie
    2021-02-10T20:01:58Z tor: SAFECOOKIE authentication challenge successful
    2021-02-10T20:01:58Z tor: AUTHCHALLENGE ServerHash fec05d578a7f60d426bc9fbee942102f458f3921db4585c5020d3295b58c56d1 ServerNonce eb57b69b846cfa0984905079b964b0662d71c134cc0afd816cb297d24d37dc10
    2021-02-10T20:01:58Z tor: Authentication successful
    2021-02-10T20:01:58Z tor: Add onion failed; error code 513
    2021-02-10T20:01:58Z Loaded 19221 addresses from peers.dat  209ms
    2021-02-10T20:01:58Z Loaded 2 addresses from "anchors.dat"
    2021-02-10T20:01:58Z 2 block-relay-only anchors will be tried for connections.
    2021-02-10T20:01:58Z init message: Starting network threads...
    2021-02-10T20:01:58Z init message: Done loading
    2021-02-10T20:01:58Z msghand thread start
    2021-02-10T20:01:58Z opencon thread start
    2021-02-10T20:01:58Z addcon thread start
    2021-02-10T20:01:58Z dnsseed thread start

    Not sure why it connects to Tor version 0.3.2.10 because I have a recent version on this machine:

    prayank@ubuntu:~/.bitcoin$ tor --version
    Tor version 0.4.4.6.

    What can be the possible reason for this error?

    bitcoin.conf file:

    testnet=1
    listen=1
    torcontrol=127.0.0.1:9051
    onlynet=onion
    debug=tor
    prune=555

    /etc/tor/torrc

    ControlPort 9051
    CookieAuthentication 1
    CookieAuthFileGroupReadable 1
    HashedControlPassword 16:07XXXXXXXXXXXXXXXXXXXXXXXXXXXX$
  2. ghost commented at 5:25 PM on February 11, 2021: none

    The issue is with Tor version being used imo because similar setup on new machine with Tor 0.4.2.7 works fine

    2021-02-11T17:21:56Z addcon thread start
    2021-02-11T17:21:56Z net thread start
    2021-02-11T17:21:56Z tor: ADD_ONION successful
    2021-02-11T17:21:56Z tor: Got service ID omy7kj7zwvfg5luayideh73uqb2latkoyyy5h65y4atv3fymnlxlzwqd, advertising service omy7kj7zwvfg5luayideh73uqb2latkoyyy5h65y4atv3fymnlxlzwqd.onion:18333
    2021-02-11T17:21:56Z tor: Cached service private key to /home/satoshi/.bitcoin/testnet3/onion_v3_private_key
    2021-02-11T17:21:56Z AddLocal(omy7kj7zwvfg5luayideh73uqb2latkoyyy5h65y4atv3fymnlxlzwqd.onion:18333,4)
    
  3. unknown closed this on Feb 11, 2021

  4. lano1106 commented at 10:26 PM on August 28, 2021: contributor

    One reason why torcontrol may return 513 is if the target is unreachable.

    Target ip is set to 127.0.0.1

    This assumes that the tor proxy is running on the same machine. That might not be the case in a LAN setup. A better approach would be to use the bind address value if specified. If not, then fallback on 127.0.0.1

  5. lano1106 commented at 2:25 PM on August 29, 2021: contributor

    I gave my idea a shot and it didn't fix the problem. I did tweak a little bit the logs to have more info. I printed the torcontrol reply first line instead of the error code. Here is what I got:

    2021-08-29T14:19:06Z tor: Add onion cmd: ADD_ONION NEW:RSA1024 Port=9999,192.168.1.179:9999
    2021-08-29T14:19:06Z tor: Add onion failed; error Invalid key type
    
  6. lano1106 commented at 2:39 PM on August 29, 2021: contributor

    I found something interesting. With tor 0.4.6.7, the algorithm RSA1024 is not accepted anymore. The only choices are:

    BEST or ED25519-V3

  7. DrahtBot locked this on Aug 29, 2022
Contributors

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-17 15:14 UTC

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