animo / animo-mediator

An easy to set-up Aries and DIDComm v1 mediator built on Aries Framework JavaScript.
9 stars 11 forks source link

Digital Ocean managed BD agent throws an error #21

Closed djleonskennedy closed 1 year ago

djleonskennedy commented 1 year ago

Hello @TimoGlastra @2mau

Could you please help with?

Trying to use DO database, and seems Asker cannot create databases there

https://github.com/hyperledger/aries-framework-javascript/issues/1614

2023-10-25 09:03:12.659  INFO  [DIDComm Chat   WalletApi.initialize] Initializing wallet 'incogme-mediator-beta' 
{
  id: 'incogme-mediator-beta',
  key: '[*****]',
  storage: {
    type: 'postgres',
    config: {
      host: 'beta-incogme-db-postgresql-fra1-do-user-13941840-0.c.db.ondigitalocean.com:25060',
      connectTimeout: 10
    },
    credentials: '[*****]'
  }
}
2023-10-25 09:03:13.146  DEBUG [DIDComm Chat   AskarWallet._open] Wallet 'incogme-mediator-beta' not found 
2023-10-25 09:03:13.146  DEBUG [DIDComm Chat   AskarWallet.createAndOpen] Creating wallet 'incogme-mediator-beta 
2023-10-25 09:03:14.294  ERROR [DIDComm Chat   AskarWallet.createAndOpen] Error creating wallet 'incogme-mediator-beta' 
{
  error: {
    stack: 'Error: Backend error\n' +
      'Caused by: error returned from database: database "postgres" does not exist\n' +
      '    at cb (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@hyperledger/aries-askar-nodejs/build/NodeJSAriesAskar.js:44:39)\n' +
      '    at Object.<anonymous> (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/ffi-napi/lib/callback.js:66:27)',
    message: 'Backend error\n' +
      'Caused by: error returned from database: database "postgres" does not exist',
    code: 1
  },
  errorMessage: 'Backend error\n' +
    'Caused by: error returned from database: database "postgres" does not exist'
}

/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@aries-framework/askar/build/wallet/AskarWallet.js:114
            throw new core_1.WalletError(errorMessage, { cause: error });
                  ^
WalletError: Error creating wallet 'incogme-mediator-beta'
    at AskarWallet.createAndOpen (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@aries-framework/askar/build/wallet/AskarWallet.js:114:19)
    at async WalletApi.createAndOpen (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@aries-framework/core/build/wallet/WalletApi.js:63:9)
    at async WalletApi.initialize (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@aries-framework/core/build/wallet/WalletApi.js:54:17)
    at async Agent.initialize (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@aries-framework/core/build/agent/BaseAgent.js:89:13)
    at async Agent.initialize (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@aries-framework/core/build/agent/Agent.js:124:9)
    at async createAgent (/Users/yuriyyakovenko/projects/incogme/mediator/build/agent.js:107:5) {
  [cause]: AriesAskarError: Backend error
  Caused by: error returned from database: database "postgres" does not exist
      at cb (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/@hyperledger/aries-askar-nodejs/build/NodeJSAriesAskar.js:44:39)
      at Object.<anonymous> (/Users/yuriyyakovenko/projects/incogme/mediator/node_modules/ffi-napi/lib/callback.js:66:27) {
    code: 1,
    extra: undefined
  }
}

Node.js v18.17.0
error Command failed with exit code 1.

Regards

djleonskennedy commented 1 year ago

Solution: postgres database should be created manualy (use PGAdmin)