openwallet-foundation/credo-ts

Connetion pool time out error while creating tenant

Sheetalsgs opened this issue · 1 comments

Hello,

I am consistently encountering the error 'AriesAskarError: Backend error - pool timed out while waiting for an open connection.' Even after changing the database, I am still facing the same issue. Please guide me on resolving this problem.

  • Here are the logs for reference:
024-01-23 07:24:52.037  DEBUG [AskarProfileWallet.open] Opening wallet for profile 'tenant-8f3278fd-c1a7-4e9f-9bf2-6cdc0b7b05e6' 
2024-01-23 07:25:02.079  ERROR [AskarProfileWallet.open] Error opening wallet for profile 'tenant-8f3278fd-c1a7-4e9f-9bf2-6cdc0b7b05e6' 
{
  error: AriesAskarError: Backend error
  Caused by: pool timed out while waiting for an open connection
      at cb (/www/node_modules/@hyperledger/aries-askar-nodejs/build/NodeJSAriesAskar.js:44:39)
      at Object.<anonymous> (/www/node_modules/ffi-napi/lib/callback.js:66:27) {
    code: 1,
    extra: undefined
  },
  errorMessage: 'Backend error\n' +
    'Caused by: pool timed out while waiting for an open connection'
}
2024-01-23 07:25:02.081  DEBUG [TenantSessionCoordinator.getContextForSession] Releasing session because an error occurred while getting the context for tenant 8f3278fd-c1a7-4e9f-9bf2-6cdc0b7b05e6 
{
  errorMessage: "Error opening wallet for profile 'tenant-8f3278fd-c1a7-4e9f-9bf2-6cdc0b7b05e6'"
}
2024-01-23 07:25:02.082  DEBUG [TenantSessionMutex.releaseSession] Releasing tenant session 
2024-01-23 07:25:02.083  DEBUG [TenantSessionMutex.releaseSession] Decreasing current sessions to 29 (max: Infinity) 
2024-01-23 07:25:02.084  ERROR [src/server.ts:79  errorHandler] Internal Server Error. 
WalletError: Error opening wallet for profile 'tenant-8f3278fd-c1a7-4e9f-9bf2-6cdc0b7b05e6'
    at AskarProfileWallet.open (/www/node_modules/@aries-framework/askar/build/wallet/AskarProfileWallet.js:101:19)
    at async WalletApi.open (/www/node_modules/@aries-framework/core/build/wallet/WalletApi.js:73:9)
    at async WalletApi.initialize (/www/node_modules/@aries-framework/core/build/wallet/WalletApi.js:47:13)
    at async TenantSessionCoordinator.createAgentContext (/www/node_modules/@aries-framework/tenants/build/context/TenantSessionCoordinator.js:160:9)
    at async /www/node_modules/@aries-framework/tenants/build/context/TenantSessionCoordinator.js:68:51 {
  cause: AriesAskarError: Backend error
  Caused by: pool timed out while waiting for an open connection
      at cb (/www/node_modules/@hyperledger/aries-askar-nodejs/build/NodeJSAriesAskar.js:44:39)
      at Object.<anonymous> (/www/node_modules/ffi-napi/lib/callback.js:66:27) {
    code: 1,
    extra: undefined
  }
}

Are you using SQLite or Postgres?

In the latest alpha we've updated Askar to not keep sessions open for longer than needed, which should help a lot with the in case of mulit-tenancy.

Please try again with the latest alpha (alpha 131 +), and make sure you configure askar to use a profile per wallet (in the askar module config)

Feel free to re-open or open a new issue if the issue persists