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

cardano-wallet server fails with unpleasant error when does not connect to http-bridge within a few seconds #409

Closed
1 task done
piotr-iohk opened this issue Jun 13, 2019 · 3 comments
Assignees

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented Jun 13, 2019

Release Operating System Cause
next Linux Code

Context

Steps to Reproduce

Start cardano-wallet server and wait for ~20 seconds

Expected behavior

Either cardano-wallet server should infinitely listen or fail more gracefully after some timeout.

Actual behavior

$ cardano-wallet server
[INFO] waiting for connection to the node...
[INFO] waiting for connection to the node...
[INFO] waiting for connection to the node...
[INFO] waiting for connection to the node...
[INFO] waiting for connection to the node...
.......
[INFO] waiting for connection to the node...
[INFO] waiting for connection to the node...
[INFO] waiting for connection to the node...
cardano-wallet: ErrNetworkTipNetworkUnreachable (ErrNetworkUnreachable "HttpExceptionRequest Request {\n  host                 = \"localhost\"\n  port                 = 8080\n  secure               = False\n  requestHeaders       = [(\"Accept\",\"text/plain\")]\n  path                 = \"/testnet/tip\"\n  queryString          = \"\"\n  method               = \"GET\"\n  proxy                = Nothing\n  rawBody              = False\n  redirectCount        = 10\n  responseTimeout      = ResponseTimeoutDefault\n  requestVersion       = HTTP/1.1\n}\n (ConnectionFailure Network.Socket.connect: <socket: 11>: does not exist (Connection refused))")

Resolution Plan

  • Handle errors as they arrive in the application instead of using unsafe code runners.

PR

Number Base
#517 master

QA

  • Networking errors now gracefully fails with a nice and colorful error message, including a few hints to guide users in their debugging.
$ cardano-wallet-jormungandr serve --genesis-hash 1234
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:05.58 UTC] Wallet backend server starting...
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:05.58 UTC] Running as v2019.6.24
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:05.58 UTC] Node is Jörmungandr on testnet
[iohk.cardano-wallet.serve.database:Notice:ThreadId 4] [2019-07-09 14:58:05.59 UTC] 13 migrations were applied to the database.
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:05.60 UTC] Waiting for Jörmungandr to be ready on tcp/8080
[iohk.cardano-wallet.serve:Alert:ThreadId 4] [2019-07-09 14:58:06.60 UTC] Waited too long for Jörmungandr to become available. Giving up!
Hint (1): If you're launching the wallet server on your own, double-check that Jörmungandr is up-and-running and listening on the same port given to '--node-port' (i.e. tcp/8080).
Hint (2): Should you be starting from scratch, make sure to have a good-enough network connection to synchronize the first blocks in a timely manner.

$ cardano-wallet-http-bridge serve 
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:25.13 UTC] Wallet backend server starting...
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:25.13 UTC] Running as v2019.6.24
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:25.13 UTC] Node is Http-Bridge on testnet
[iohk.cardano-wallet.serve.database:Notice:ThreadId 4] [2019-07-09 14:58:25.14 UTC] 13 migrations were applied to the database.
[iohk.cardano-wallet.serve:Info:ThreadId 4] [2019-07-09 14:58:25.15 UTC] Waiting for http-bridge to be ready on tcp/8080
[iohk.cardano-wallet.serve:Alert:ThreadId 4] [2019-07-09 14:58:26.15 UTC] Waited too long for http-bridge to become available. Giving up!
Hint (1): If you're launching the wallet server on your own, double-check that http-bridge is up-and-running and listening on the same port given to '--node-port' (i.e. tcp/8080).
Hint (2): Should you be starting from scratch, make sure to have a good-enough network connection to synchronize the first blocks in a timely manner
  • Perhaps worth having one or two automated tests regarding this, though the actual time-out is ~60 seconds... And that's not something we are free to tweak at the command-line level. Perhaps a manual test would be fine here?
@piotr-iohk piotr-iohk added the BUG label Jun 13, 2019
@KtorZ
Copy link
Member

KtorZ commented Jun 13, 2019

or fail more gracefully after some timeout.

Well, this is our "graceful termination after timeout" already 😂 ... I guess we can work out a better error message 🤷‍♂️

@KtorZ KtorZ added CONFIRMED and removed BUG labels Jun 14, 2019
@KtorZ KtorZ added this to the Bugs Sprint 25-26 milestone Jun 27, 2019
@KtorZ KtorZ self-assigned this Jul 9, 2019
@piotr-iohk
Copy link
Contributor Author

Integration tests added in #528.
¯_(ツ)_/¯

@piotr-iohk
Copy link
Contributor Author

lgtm 👍 (#528 to be merged later, but I can close this one)

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