This is the error I get when I run my Nest js app in Docker, It runs perfectly without Docker :

 DEBUG: Starting HTTP inbound transport {
   "port": 8000
 }
 DEBUG: Starting HTTP outbound transport
DEBUG: Mediator routing record not loaded yet, retrieving from storage
 DEBUG: Connecting to ledger pool 'BCOVRIN_TEST_GENESIS' {
   "genesisPath": "/tmp/afj/genesis-BCOVRIN_TEST_GENESIS.txn"
 }
 DEBUG: Pool 'BCOVRIN_TEST_GENESIS' does not exist yet, creating. {
   "indyError": "PoolLedgerNotCreatedError"
 }
 ERROR: Connection to pool: /tmp/afj/genesis-BCOVRIN_TEST_GENESIS.txn failed. {
   "error": {
     "name": "IndySdkError",
    "message": "IndyError(CommonInvalidStructure): CommonInvalidStructure",
     "stack": "IndySdkError: IndyError(CommonInvalidStructure): CommonInvalidStructure\n    at IndyPool.connectToLedger (/app/node_modules/@aries-framework/core/build/modules/ledger/IndyPool.js:84:52)",
     "cause": {
      "name": "IndyError",
       "stack": "IndyError: CommonInvalidStructure\n    at Object.callback (/app/node_modules/indy-sdk/src/wrapIndyCallback.js:15:10)",
      "message": "CommonInvalidStructure",
       "indyCode": 113,
       "indyName": "CommonInvalidStructure",
       "indyCurrentErrorJson": null
     }
   }
 }
 WARN: Error connecting to ledger, will try to reconnect when needed. {
   "error": {
    "name": "IndySdkError",
     "message": "IndyError(CommonInvalidStructure): CommonInvalidStructure",
    "stack": "IndySdkError: IndyError(CommonInvalidStructure): CommonInvalidStructure\n    at IndyPool.connectToLedger (/app/node_modules/@aries-framework/core/build/modules/ledger/IndyPool.js:84:52)",
     "cause": {
      "name": "IndyError",
       "stack": "IndyError: CommonInvalidStructure\n    at Object.callback (/app/node_modules/indy-sdk/src/wrapIndyCallback.js:15:10)",
      "message": "CommonInvalidStructure",
       "indyCode": 113,
       "indyName": "CommonInvalidStructure",
      "indyCurrentErrorJson": null
     }
   }
 }  

I tried passing in genesis tx directly rather than environment file and also tried sending genesis url, Both are gaving this same error.

1

There are 1 best solutions below

0
erenakyildiz On

If your genesis file was able to connect you to the pool ledger when run locally, the problem might be with line endings of genesis.txn file, in windows the endline char is \r\n and in linux it is \n, this may be creating a problem when you are running in docker and the endline char is still \r\n and the OS is no longer windows but linux, try to look at the genesis file (if you use an editor like notepad++ you can see the line endings as the chars such as \r\n and \n) and make sure it is correct.