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

xud crashed on openchannel command #1405

Closed
kilrau opened this issue Feb 24, 2020 · 3 comments · Fixed by #1463
Closed

xud crashed on openchannel command #1405

kilrau opened this issue Feb 24, 2020 · 3 comments · Fixed by #1463
Assignees
Labels
bug Something isn't working P2 mid priority

Comments

@kilrau
Copy link
Contributor

kilrau commented Feb 24, 2020

Background

testnet > openchannel 037a74737630bb5a9979762b2163ef9f95c81e00caf347bacc17f16991cdbb61f7 btc 0.01
Error: 2 UNKNOWN: Stream removed
testnet > getbalance
xud is locked, run 'xucli unlock', 'xucli create', or 'xucli restore' then try again

xud logs don't show anything about the crash:

24/02/2020 11:36:08.096 [ORDERBOOK] debug: order added: {"id":"d91ddd80-56f9-11ea-af85-695a8a4bd11a","pairId":"LTC/BTC","price":0.00825615,"quantity":10000000,"isBuy":false,"peerPubKey":"037a74737630bb5a9979762b2163ef9f95c81e00caf347bacc17f16991cdbb61f7","createdAt":1582544168095,"initialQuantity":10000000}
24/02/2020 11:36:10.256 [RPC] debug: received call /xudrpc.Xud/ListPeers
24/02/2020 11:36:21.416 [RPC] debug: received call /xudrpc.Xud/ListPeers
24/02/2020 11:36:23.670 [BACKUP] debug: raiden database changed
24/02/2020 11:36:32.387 [BACKUP] debug: raiden database changed
24/02/2020 11:36:45.342 [BACKUP] debug: raiden database changed
24/02/2020 11:36:51.850 [BACKUP] debug: raiden database changed
24/02/2020 11:36:54.251 [BACKUP] debug: raiden database changed
24/02/2020 11:36:58.247 [RPC] debug: received call /xudrpc.Xud/OpenChannel
24/02/2020 11:37:04.058 [GLOBAL] info: config file loaded
24/02/2020 11:37:04.065 [RPC] info: gRPC server listening on 0.0.0.0:8886
24/02/2020 11:37:04.161 [DB] info: connected to database /root/.xud/xud-testnet.db
24/02/2020 11:37:04.185 [LND-BTC] debug: loaded tls cert from /root/.lndbtc/tls.cert
24/02/2020 11:37:04.187 [LND-LTC] debug: loaded tls cert from /root/.lndltc/tls.cert
24/02/2020 11:37:04.188 [RAIDEN] info: RaidenClient status: Initialized
24/02/2020 11:37:04.189 [RAIDEN] info: trying to verify connection to raiden with uri: raiden:5001
24/02/2020 11:37:04.195 [LND-BTC] debug: loaded macaroon from /root/.lndbtc/data/chain/bitcoin/testnet/admin.macaroon
24/02/2020 11:37:04.197 [LND-LTC] debug: loaded macaroon from /root/.lndltc/data/chain/litecoin/testnet/admin.macaroon

lnd.log

Your environment

  • version of xud: 1.0.0-beta-c65f376
  • which operating system (uname -a on *Nix): xud-docker amd64
  • version of btcd, bitcoind, ltcd, litecoind, geth, parity, raiden, lnd or other chain backend:
  • any other relevant environment details: testnet

Steps to reproduce

Launch testnet, deposit some testnet bitcoin and run openchannel 037a74737630bb5a9979762b2163ef9f95c81e00caf347bacc17f16991cdbb61f7 btc 0.01

Expected behaviour

channel is opened

Actual behaviour

xud crashes

@kilrau kilrau added bug Something isn't working P2 mid priority labels Feb 24, 2020
@kilrau kilrau assigned ghost Feb 24, 2020
@kilrau
Copy link
Contributor Author

kilrau commented Feb 24, 2020

Running it again after a while - just worked:

testnet > xucli openchannel 037a74737630bb5a9979762b2163ef9f95c81e00caf347bacc17f16991cdbb61f7 btc 0.005
success

PS can we catch arg errors a bit nicer? @sangaman

testnet > openchannel 037a74737630bb5a9979762b2163ef9f95c81e00caf347bacc17f16991cdbb61f7 0.01 btc

/app/node_modules/yargs/yargs.js:1175
      else throw err
           ^
Error [AssertionError]: Assertion failed
    at new goog.asserts.AssertionError (/app/node_modules/google-protobuf/google-protobuf.js:81:876)
    at Object.goog.asserts.doAssertFailure_ (/app/node_modules/google-protobuf/google-protobuf.js:82:257)
    at Object.goog.asserts.assert (/app/node_modules/google-protobuf/google-protobuf.js:83:83)
    at jspb.BinaryWriter.writeInt64 (/app/node_modules/google-protobuf/google-protobuf.js:482:77)
    at Function.proto.xudrpc.OpenChannelRequest.serializeBinaryToWriter (/app/dist/proto/xudrpc_pb.js:5986:12)
    at proto.xudrpc.OpenChannelRequest.serializeBinary (/app/dist/proto/xudrpc_pb.js:5956:35)
    at serialize_xudrpc_OpenChannelRequest (/app/dist/proto/xudrpc_grpc_pb.js:352:26)
    at Object.final_requester.sendMessage (/app/node_modules/grpc/src/client_interceptors.js:807:37)
    at InterceptingCall._callNext (/app/node_modules/grpc/src/client_interceptors.js:419:43)
    at InterceptingCall.sendMessage (/app/node_modules/grpc/src/client_interceptors.js:464:8) {
  message: 'Assertion failed',
  reportErrorToServer: true,
  messagePattern: 'Assertion failed'
}

@kilrau kilrau added P3 low priority and removed P2 mid priority labels Feb 24, 2020
@kilrau
Copy link
Contributor Author

kilrau commented Feb 27, 2020

Just had this again on xud1.testnet:

testnet > openchannel 02b4246846396d462acfb9f7745b8734f56d08cb617d20d319cd6690455e133be2 ltc 5
Error: 2 UNKNOWN: Stream removed
testnet > getbalance
xud is locked, run 'xucli unlock', 'xucli create', or 'xucli restore' then try again

https://paste.ubuntu.com/p/W8GnMthfh7/

@kilrau
Copy link
Contributor Author

kilrau commented Feb 27, 2020

And again, after unlocking xud post-crash, waiting for reconnect it just worked:

testnet > openchannel 02b4246846396d462acfb9f7745b8734f56d08cb617d20d319cd6690455e133be2 ltc 5
success

@kilrau kilrau assigned sangaman and unassigned ghost Mar 31, 2020
@kilrau kilrau added P2 mid priority and removed P3 low priority labels Mar 31, 2020
sangaman added a commit that referenced this issue Apr 9, 2020
This removes the hard timeout placed on each attempt to connect to a
peer's lnd node when attempting to open a channel with that peer. This
timeout was causing xud to crash because it threw an error that was not
being handled in the encapsulating catch block, which did not catch the
error because it was thrown from a callback.

Rather than attempt to correct the asynchronous exception handling,
this lifts the timeout limit set within xud and instead will wait on
each connect attempt until it succeeds, times out, or fails according to
the logic within lnd.

Fixes #1405.
sangaman added a commit that referenced this issue Apr 9, 2020
This removes the hard timeout placed on each attempt to connect to a
peer's lnd node when attempting to open a channel with that peer. This
timeout was causing xud to crash because it threw an error that was not
being handled in the encapsulating catch block, which did not catch the
error because it was thrown from a callback.

Rather than attempt to correct the asynchronous exception handling,
this lifts the timeout limit set within xud and instead will wait on
each connect attempt until it succeeds, times out, or fails according to
the logic within lnd.

Fixes #1405.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 mid priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants