Moneyd tutorial giving error message on testnet

@kincaid thanks for getting that merged in. @martinlowinski can you update your ilp-plugin-xrp-asym-server and restart your connector? Let us know if any issues are cropping up after that.

I’ve updated ilp-plugin-xrp-asym-server to 1.8.1 and the invalid claim error is gone. Thanks @kincaid!

However, the following two errors persist (maybe correlated). The first one is coming from the moneyd instance on the receiver side:

  connector:ilp-prepare:trace sending outbound ilp prepare. destination=test.foobar.ilsp.hNXZeuksRjGgx-K1V7Kd3trB6eJW082ekwxowFPOzz4.local.Ma60BnWNz4oV5FmFTFquNTzHp2CLqVj-STSIffnItXo amount=0 +2ms
2019-04-17T11:26:51.213Z connector:error-handler-middleware[parent] debug error in data handler, creating rejection. ilpErrorCode=F02 error=Error: failed to send packet: No clients connected for account Ma60BnWNz4oV5FmFTFquNTzHp2CLqVj-STSIffnItXo
    at Plugin.<anonymous> (/moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/src/index.ts:474:13)
    at Generator.next (<anonymous>)
    at /moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/src/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/src/index.js:3:12)
    at Plugin._handleOutgoingBtpPacket (/moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/src/index.js:365:16)
    at Plugin._call (/moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/node_modules/ilp-plugin-btp/src/index.ts:677:16)
    at Plugin.<anonymous> (/moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/src/index.ts:368:34)
    at Generator.next (<anonymous>)
    at /moneyd-xrp-testnet/node_modules/ilp-plugin-mini-accounts/src/index.js:7:71

The second error occurs after ilp-spsp-server received some money:

got packet for 100 units
  ilp-protocol-stream:Server:Connection telling other side that stream 1 can receive 10000000000000 +0ms
  ilp-protocol-stream:Server:Connection fulfilling prepare with fulfillment: 9eea658b24a381760ed7822566f438bfc2d90fde551cc50e099ab1c655ad096b and response packet: {"sequence":"6","ilpPacketType":13,"prepareAmount":"100","frames":[{"type":3,"name":"ConnectionMaxData","maxOffset":"65534"},{"type":18,"name":"StreamMaxMoney","streamId":"1","receiveMax":"10000000000000","totalReceived":"100"},{"type":21,"name":"StreamMaxData","streamId":"1","maxOffset":"16384"}]} +1ms
  ilp-plugin-btp:trace sending btp packet. type=TYPE_RESPONSE requestId=560113694 info=ilp-fulfill +6ms
  ilp-plugin-btp:trace sending btp packet. type=TYPE_MESSAGE requestId=4171818002 info=ilp-prepare +1ms
  ilp-plugin-btp:trace received btp packet. type=TYPE_RESPONSE requestId=4171818002 info=ilp-reject +27s
  ilp-protocol-stream:Server:Connection packet 1 was rejected +27s
  ilp-protocol-stream:Server:Connection handling reject: {"code":"R00","triggeredBy":"test.foobar.ilsp.hNXZeuksRjGgx-K1V7Kd3trB6eJW082ekwxowFPOzz4","message":"packet expired.","data":{"type":"Buffer","data":[]}} +0ms
  ilp-protocol-stream:Server:Connection unexpected error. code: R00, message: packet expired., data:  +0ms
  ilp-protocol-stream:Server:Connection destroying connection with error: Error: Unexpected error while sending packet. Code: R00, message: packet expired.
    at Connection.<anonymous> (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.ts:1155:13)
    at Generator.next (<anonymous>)
    at /usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:3:12)
    at Connection.handleConnectorError (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:778:16)
    at Connection.<anonymous> (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.ts:1059:21)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7) +0ms
  ilp-protocol-stream:Server:Connection error in error handler: Error: Unexpected error while sending packet. Code: R00, message: packet expired.
    at Connection.<anonymous> (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.ts:1155:13)
    at Generator.next (<anonymous>)
    at /usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:3:12)
    at Connection.handleConnectorError (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:778:16)
    at Connection.<anonymous> (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.ts:1059:21)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/lib/node_modules/ilp-spsp-server/node_modules/ilp-protocol-stream/src/connection.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7) +30ms
  ilp-protocol-stream:Server:Stream:1 destroying stream because of error: null +27s

I’ve tested it with strata-ilsp.com/testnet/xrp and my own connector test.foobar.

It looks like it is struggling to establish a stream. Are you running a local moneyd and ilp-spsp-server that is reachable through a localtunel domain?

Yes, my setup looks like this (all wallets are created using the testnet faucet):

  • Sender moneyd runs on my local machine
    • DEBUG=* bin/moneyd.js xrp:start --testnet
    • Connected to either strata-ilsp.com/testnet/xrp or my own connector test.foobar
  • Receiver moneyd and ilp-spsp-server runs on a VPS
    • DEBUG=* bin/moneyd.js xrp:start --testnet
    • Connected to either strata-ilsp.com/testnet/xrp or my own connector test.foobar
    • DEBUG=ilp* ilp-spsp-server (ilp-spsp-server@1.1.0)

Querying the ilp-spsp-server works (ilp-spsp query -r '$20ff4135dfe944db.localtunnel.me'):

  ilp-plugin:debug creating plugin with module ilp-plugin-btp +0ms
  ilp-plugin:debug creating plugin with credentials { server: 'btp+ws://:0c09d2901ea7520279cf6031696c8b77@localhost:7768' } +1ms
{
  "destinationAccount": "test.strata.xrpClients.Akyjp235B7jVWibNDYEsQLLHkQhh3-Fyqtnk8zTOUi8.local.z_avrm1t_R_cQ_JXpe1nwCnHjrBJprLS7iwzsqspJME.Xs62hliILP4dT2iEWSrZlqGp",
  "sharedSecret": "xnlks6JNv1rUxNhxk6/qK0tegPypI7OC4arngY0LgXI=",
  "contentType": "application/spsp4+json"
}

This is the package.json of both moneyd instances:

 "dependencies": {
    "chalk": "^2.4.2",
    "ilp-connector": "^22.4.1",
    "ilp-plugin-mini-accounts": "^4.0.5",
    "ilp-store-memory": "^1.0.0",
    "moment": "^2.24.0",
    "moneyd-uplink-xrp": "^1.3.5",
    "node-fetch": "^2.3.0",
    "yargs": "^12.0.5"
  },

When using the package.json of moneyd@4.4.0, it always resulted in an Error: Unable to establish connection, no packets meeting the minimum exchange precision of 3 digits made it through the path. After updating the outdated ilp dependencies to latest, the error was gone (should I open a pull request for that?).

ilp-connector                    22.1.0  22.4.1  22.4.1  moneyd
ilp-plugin-mini-accounts          3.5.1   3.6.0   4.0.5  moneyd

Quick update: I’ve done some further tests with the connector from strata and also my own connector. This issue persists, I couldn’t find any workarounds:

error in data handler, creating rejection. ilpErrorCode=F02
error=Error: failed to send packet: No clients connected for account x1HCH-cv_o6atDFdVBy0OtF0JamKTaIx9apBaUC5qYc

Any recommendations on how to debug this?