aries-askar
aries-askar copied to clipboard
AskarWallet.close: Invalid resource handle
We have a node project that is running test suites via jest. In two of the suites, we are using AFJ to test mediation cases. All AFJ agents are using Askar, and mediator agents are using postgres storage.
On MacOS, the tests are consistently working fine without any failures, but on Linux (Ubuntu 20.04) some test suites are failing to start due to Askar closing errors:
WalletError: Error closing wallet': Resource handle in use
at AskarWallet.close (node_modules/@aries-framework/askar/src/wallet/AskarWallet.ts:383:13)
at WalletApi.close (node_modules/@aries-framework/core/src/wallet/WalletApi.ts:97:5)
at Agent.shutdown (node_modules/@aries-framework/core/src/agent/Agent.ts:218:7)
and
ERROR: Error closing wallet': Invalid resource handle {
"error": {
"name": "Error",
"stack": "Error: Invalid resource handle\n at NodeJSAriesAskar.handleError (/app/node_modules/@hyperledger/aries-askar-nodejs/src/NodeJSAriesAskar.ts:200:11)\n at cb (/app/node_modules/@hyperledger/aries-askar-nodejs/src/NodeJSAriesAskar.ts:144:16)\n at Object.<anonymous> (/app/node_modules/ffi-napi/lib/callback.js:66:27)\n at Object.callbackTrampoline (node:internal/async_hooks:130:17)",
"message": "Invalid resource handle",
"code": 5
},
"errorMessage": "Invalid resource handle"
}
Note, this is only happening on Linux (via Github Actions), and is not happening ALL of the time. Just most of the time.
Update: We use Node v18.16.0