Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tari_base_node: UnknownError on Fedora 34 #3423

Open
therustmonk opened this issue Oct 5, 2021 · 3 comments
Open

tari_base_node: UnknownError on Fedora 34 #3423

therustmonk opened this issue Oct 5, 2021 · 3 comments

Comments

@therustmonk
Copy link
Contributor

Describe the bug
Node failed with UnknownError on Fedora 34.

To Reproduce
Steps to reproduce the behavior:

  1. Run tor:
$ sudo -u toranon tor --allow-missing-torrc --ignore-missing-torrc --clientonly 1 --socksport 9050 --controlport 127.0.0.1:9051 --log "notice stdout" --clientuseipv6 1
  1. Run tari_base_node:
cargo run --bin tari_base_node
  1. Node failed with:
Running `target/debug/tari_base_node`
Initializing logging according to "/home/denis/.tari/config/log4rs_base_node.yml"
00:10 WARN  DNS seed `seeds.weatherwax.tari.com` failed to resolve: Client failure: request timed out
00:10 ERROR Network discovery errored: Connectivity error: Internal actor response was unexpectedly cancelled. Waiting for 5s
00:10 WARN  Failed to mark offline time: JoinError(JoinError::Cancelled)
00:10 ERROR DhtConnectivity exited with error: ConnectivityError(ActorDisconnected)
UnknownError
00:10 ERROR Exiting with code (102): UnknownError
  1. And there is a warning in the tor's logs:
Oct 05 18:12:12.000 [notice] New control connection opened from 127.0.0.1.
Oct 05 18:12:12.000 [warn] Got authentication cookie with wrong length (0)

Desktop (please complete the following information):
Linux fedora 5.14.9-200.fc34.x86_64 #1 SMP Thu Sep 30 11:55:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Tor version 0.4.5.10.

@therustmonk
Copy link
Contributor Author

therustmonk commented Oct 5, 2021

I already solved it and put this issue to help other Fedora users.

Fedora sets the value of CookieAuthentication parameter (of tor) to 1 in the /etc/tor/torrc config file.
Changing it to 0 and restarting tor solves the issue, but I'm not sure it's a secure way to solve that.

man tor fragment:

CookieAuthentication 0|1
If this option is set to 1, allow connections on the control port when the connecting process knows the contents of a file named "control_auth_cookie", which Tor will create in its data directory. This authentication method should only be used on systems with good filesystem security. (Default: 0)

@delta1
Copy link
Contributor

delta1 commented Oct 6, 2021

Nice find. There is an option to provide a tor password or cookie in config.toml so you don’t have to run tor without auth 👍 will link to it later

@delta1
Copy link
Contributor

delta1 commented Oct 6, 2021

Resolution for this is to at least have a more descriptive error or log message pointing to the tor auth issue

aviator-app bot pushed a commit that referenced this issue Oct 8, 2021
Description
---
This PR adds (requires) details to `UnknownError`.

Motivation and Context
---
Related to #3423 
Without the fix some errors are indiscernible. Example:

```sh
     Running `target/debug/tari_base_node`
Initializing logging according to "/home/denis/.tari/config/log4rs_base_node.yml"
10:47 ERROR Network discovery errored: Connectivity error:
    Internal actor response was unexpectedly cancelled. Waiting for 5s
10:47 ERROR DhtConnectivity exited with error: ConnectivityError(ActorDisconnected)
UnknownError
10:47 ERROR Exiting with code (102): UnknownError
```

With the fix:

```sh
     Running `target/debug/tari_base_node`
Initializing logging according to "/home/denis/.tari/config/log4rs_base_node.yml"
10:48 ERROR Network discovery errored: Connectivity error:
    Internal actor response was unexpectedly cancelled. Waiting for 5s
UnknownError("Failed to initialize tor hidden service: TorClientError: Command failed:
    Authentication failed: Wrong length on authentication cookie.")
10:48 ERROR Exiting with code (102): UnknownError("Failed to initialize tor
    hidden service: TorClientError: Command failed: Authentication failed:
    Wrong length on authentication cookie.")
```

How Has This Been Tested?
---
Manually by activating **CookieAuthentication 1** option in the Tor's settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants