Open
Description
Ok, so. I tried to run tests - written in AVA. For some reason. I quickly figured out the code responsible:
It was hanging on the createSubAccount
. Sadly after a long timeout all I got was this:
Error (TypedError) {
context: undefined,
type: 'RetriesExceeded',
message: 'Exceeded 10 attempts for http://localhost:1593.',
}
› Object.fetchJson (node_modules/near-api-js/lib/utils/web.js:55:15)
› async node_modules/near-api-js/lib/providers/json-rpc-provider.js:312:34
› async Object.exponentialBackoff [as default] (node_modules/near-api-js/lib/utils/exponential-backoff.js:7:24)
› async JsonRpcProvider.sendJsonRpc (node_modules/near-api-js/lib/providers/json-rpc-provider.js:304:26)
› async JsonRpcProvider.query (node_modules/near-api-js/lib/providers/json-rpc-provider.js:116:22)
› async Account.findAccessKey (node_modules/near-api-js/lib/account.js:186:31)
› async Account.signTransaction (node_modules/near-api-js/lib/account.js:91:31)
Adding NEAR_WORKSPACES_DEBUG=true
didn't help either.
One of the issues is that the code handling backoffs is hiding the reason of the failure, making it hard to track the real issues.
In the end the issue here is:
error: FetchError: request to http://localhost:1592/ failed, reason: connect ECONNREFUSED ::1:1592
Meaning that even though near-sandbox
listens on IPv4 the app attempts to connect at IPv6. Not sure what the right fix here is, probably near-sandbox should also listen on IPv6 or maybe the url shouldn't use localhost
but the IP address instead.
> node -v
v19.6.0
Metadata
Assignees
Type
Projects
Status
NEW❗