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

Application dies shortly after launch while attempting to connect with Tor with error "Auth cookie not created" #2398

Closed
devinbileck opened this issue Feb 8, 2019 · 17 comments · Fixed by #2581
Assignees

Comments

@devinbileck
Copy link
Member

When launching Bisq on my Windows 10 VM, it dies several seconds later and doesn't get past this on the splash screen:
image

In the log:
Feb-08 10:59:37.065 [NetworkNode-9999] ERROR b.n.p.n.TorNetworkNode: Could not connect to running Tor: java.io.IOException: Auth cookie not created

I am consistently encountering it on my VM, but not on my primary Windows 10 machine. I have investigated/eliminated possible causes such as firewall, antivirus, file permissions and as of yet been unable to determine the root cause.

I see it is creating an empty tor/.tor/control_auth_cookie file, but not writing to it. While looking at the netlayer module, it throws this exception if the file is not written to within 3 seconds.
https://github.com/JesusMcCloud/netlayer/blob/master/tor.native/src/main/kotlin/org/berndpruenster/netlayer/tor/TorContext.kt#L346

At this point the only thing I can think of is it perhaps could be a timing issue with my VM running slower than my primary machine and it taking longer than 3 seconds to write to this file. But I am not familiar with the netlayer module nor with tor in general.

devinbileck added a commit to devinbileck/bisq that referenced this issue Feb 8, 2019
Issue: If an IOException is raised when attempting to create
tor and the hidden service, the application will just quit without
any indication to the user. One particular scenario where this occurs
is mentioned in bisq-network#2398.

Cause: There is an explicit statement to exit the application when an
IOException is raised.

Fix: Rather than just exit the application, show an error message
and inform the user what went wrong.
@devinbileck
Copy link
Member Author

I have a fix that will show an error message rather than just exiting the application when this is encountered.
image

This may also address some of the other recent reported issues with the application exiting shortly after launch.

@scottydk
Copy link

I just downloaded and installed Bisq for the first time, and I am getting the same error. Do you know how I can fix this issue?

@ghost
Copy link

ghost commented Feb 27, 2019

If you could give a bit more informations about your configuration (what OS) and connection, it may help.

@scottydk
Copy link

I installed it on my windows laptop. Not sure about connection.

@devinbileck
Copy link
Member Author

At this point I have been unable to determine the cause or a possible workaround. However, this is on the list of things to do for @freimair.

@freimair
Copy link
Member

freimair commented Mar 7, 2019

seems to be closely related to #1299

devinbileck added a commit to devinbileck/bisq that referenced this issue Mar 11, 2019
A recent change in the netlayer is now seeing exceptions wrapped in
a TorCtlException being raised if an error occurs while setting up tor.

So when the "Auth cookie not created" issue occurs (bisq-network#2398), it was
restarting tor rather than showing the error message to the user.
devinbileck added a commit to devinbileck/bisq that referenced this issue Mar 14, 2019
A recent change in the netlayer is now seeing exceptions wrapped in
a TorCtlException if an error occurs while setting up Tor.

So when an issue such as "Auth cookie not created" (bisq-network#2398) occurs,
which was previously raised as an IOException, it was restarting Tor
rather than showing the error message to the user.
@devinbileck
Copy link
Member Author

On my VM that consistently exhibits this issue, increasing the COOKIE_TIMEOUT resolves it. I just doubled it to 6 seconds.
https://github.com/JesusMcCloud/netlayer/blob/master/tor.native/src/main/kotlin/org/berndpruenster/netlayer/tor/TorContext.kt#L63

@ManfredKarrer
Copy link
Member

@freimair Could you change the timeout if that helps?

@freimair
Copy link
Member

I will prepare a fresh netlayer release and PR it right away

@user135711
Copy link

user135711 commented Apr 1, 2019

I'm still getting this on one of my windows OS's with the newest version bisq 0.9.5.

@devinbileck
Copy link
Member Author

@user135711 the fix for this will be available in our upcoming release (this week).

@milseg
Copy link

milseg commented Oct 27, 2019

For some reason i could bypass that using a VPN

@Rowdster
Copy link

Rowdster commented Dec 9, 2019

I regularly get "connecting to bisq network failed error java.io.IOException: auth cookie not created". I'm using the provided gateways, and I'm running from source build. Is there anything I can share, or get additional logging?
This is windows 10 VM on a celeron CPU, 5GB ram, so it's on the lower end of hardware. I don't know that I can modify from 3 to 6 seconds since TorContext.kt is not part of the bisq git pull

@devinbileck
Copy link
Member Author

@freimair unless you have another idea, looks like we may need to increase the timeout further?

@freimair
Copy link
Member

freimair commented Dec 11, 2019

the timeout is already at 10 seconds. This is way too long already. Just think of it. Even windows machines are not that slow :). No, seriously, there is something else going on. Unfortunately, I cannot reproduce the issue with even a VM @devinbileck provided me as faulty.

EDIT: after sifting through the code again I found a code branch giving some insight in what might happen:

            if (OsType.current != OsType.WIN) {
                val exit = torProcess.waitFor()

with a comment saying that for non-Win OSs, the torProcess is only used to start up tor and is then being waited for, which is a guarantee that tor is up and running. On Win, tor is run inside the torProcess and hence, there is no such gate.

The timeout therefore has to be bigger for Win to function equally.

@Rowdster
Copy link

Also, I have available the source build and am currently using as my bisq app. I can make any local code changes that might help provide any additional insight if you can think of anything helpful

@theamericans47
Copy link

I've the same issue, I've just installed on Windows 10 and manages firewall rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants