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

Stuck waiting for "Connecting to server, please wait..." #587

Closed
alevchuk opened this issue Jun 3, 2022 · 5 comments
Closed

Stuck waiting for "Connecting to server, please wait..." #587

alevchuk opened this issue Jun 3, 2022 · 5 comments

Comments

@alevchuk
Copy link

alevchuk commented Jun 3, 2022

Context:
In Preferences -> Server, I'm trying to change configuration of my server (bitcoin node is up but the auth is not correct).

Problem:
All the buttons are grayed-out (not clickable). Seem I have to wait for 10 minutes+ (forever?) for the connection attempt to time out. Long enough to fill out this issue.

Workarounds?
Can't find any. Turing off network does not help.

Versions:
I have Bitcoin Core version v23.0 and Sparrow 5da9532 (earlier version of Sparrow had that issue too).

Screenshot:
Screenshot from 2022-06-03 08-53-55

@h76oeI6pMxU9g4p8aCpc6Q
Copy link

I sometimes encounter this situation too. I think sparrow did not set the "timeout" parameter for network requests.

In the case of a normal network request, if no response is received after 5 seconds, it should be considered invalid and the request should be retried or cancelled.

At the very least, the user should be informed of the status of the request, such as "timeout", "retry", "cancel".

If only "Connecting to server, please wait..."is displayed for a long time, the user does not know if the connection is successful or unsuccessful.

@craigraw
Copy link
Collaborator

craigraw commented Jun 6, 2022

I think sparrow did not set the "timeout" parameter for network requests.

Sparrow actually does set the timeout parameter, asking the BWT library to perform a socket timeout after 30 seconds when using the 'Test Connection' button. I've just tested this against a firewall set to drop packets, and Sparrow did indicate a failure to connect after 30 seconds had elapsed.

However, Sparrow does not set a socket timeout parameter in BWT when connecting to Bitcoin Core outside of 'Test Connection'. This is because the timeout parameter applies to read and write timeouts as well, and typically it can take many minutes or even hours to import and scan addresses in a new wallet, especially when the birth date has been set many years back. The read timeout here causes BWT to timeout waiting for Bitcoin Core to do this, resulting in a failure of the wallet import.

(That said, I was actually unable to recreate the described behaviour, getting an OS-level socket connection timeout even when connecting outside of 'Test Connection'. I suspect this is due to network level configuration. )

I believe this issue can be resolved by allowing Sparrow to set a separate socket connect timeout (apart from the read timeout) so that both situations can be handled. I have added an issue for this: bwt-dev/bwt#99

@jamwil
Copy link

jamwil commented Aug 8, 2022

In the meantime, is there a way for the user to get out of this state? Restarting Sparrow doesn't work. Can I modify a config file directly to remove the problematic server connection?

Edit: I ended up stopping bitcoin-core to get out of the hung state.

@craigraw
Copy link
Collaborator

craigraw commented Aug 9, 2022

Can I modify a config file directly to remove the problematic server connection?

Sparrow's config is available in the Sparrow home folder - see the config file - and can edited in a text editor.

@craigraw
Copy link
Collaborator

While it seems unlikely that BWT will be updated to fix this, Sparrow v1.7.2 was released with a new Core <-> Electrum server implementation called Cormorant that will be used if the version of Bitcoin Core >= 24. A connection timeout of around 5 seconds is used.

I'm closing this off, it's probably as resolved now as it's ever going to be.

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

4 participants