todo-list-fabricV1 icon indicating copy to clipboard operation
todo-list-fabricV1 copied to clipboard

I got this problem Failed to load user "admin" from local key value store

Open Gxz-NGU opened this issue 6 years ago • 1 comments

When I run this command:

node test/integration/e2e/create-channel.js

I got this Error Message:

info: [Client.js]: Failed to load user "admin" from local key value store
info: [FabricCAClientImpl.js]: Successfully constructed Fabric CA client from options - {"protocol":"http","hostname":"localhost","port":7054}
info: [FabricCAClientImpl.js]: Successfully constructed Fabric CA service client: endpoint - {"protocol":"http","hostname":"localhost","port":7054}
info: [crypto_ecdsa_aes]: This class requires a CryptoKeyStore to save keys, using the store: {"opts":{"path":"/root/.hfc-key-store"}}
not ok 1 Error: Could not parse enrollment response [404 page not found ] as JSON due to error [SyntaxError: Unexpected token p in JSON at position 4] at IncomingMessage.<anonymous> (/usr/local/dockerImages/fabric-sdk-node/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:560:14) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)
  ---
    operator: fail
    at: cop.enroll.then.then.then.catch (/usr/local/dockerImages/fabric-sdk-node/test/unit/util.js:116:8)
    stack: |-
      Error: Error: Could not parse enrollment response [404 page not found
      ] as JSON due to error [SyntaxError: Unexpected token p in JSON at position 4]
          at IncomingMessage.<anonymous> (/usr/local/dockerImages/fabric-sdk-node/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:560:14)
          at emitNone (events.js:91:20)
          at IncomingMessage.emit (events.js:185:7)
          at endReadableNT (_stream_readable.js:974:12)
          at _combinedTickCallback (internal/process/next_tick.js:74:11)
          at process._tickCallback (internal/process/next_tick.js:98:9)
          at Test.assert [as _assert] (/usr/local/dockerImages/fabric-sdk-node/node_modules/tape/lib/test.js:224:54)
          at Test.bound [as _assert] (/usr/local/dockerImages/fabric-sdk-node/node_modules/tape/lib/test.js:76:32)
          at Test.fail (/usr/local/dockerImages/fabric-sdk-node/node_modules/tape/lib/test.js:317:10)
          at Test.bound [as fail] (/usr/local/dockerImages/fabric-sdk-node/node_modules/tape/lib/test.js:76:32)
          at cop.enroll.then.then.then.catch (/usr/local/dockerImages/fabric-sdk-node/test/unit/util.js:116:8)
          at process._tickCallback (internal/process/next_tick.js:103:7)
  ...

1..1
# tests 1
# pass  0
# fail  1

I try to analyze the source code. I realize that when I debug in fabric-sdk-node/test/unit/util.js on 104 line:

return cop.enroll({ enrollmentID: username, enrollmentSecret: password })

it seems like cop can not invoke its method enroll(req). Because I input console.log("test") in fabric-sdk-node/fabric-ca-client/lib/FabricCAClientImpl.js on 121 line:

/** * Enroll the member and return an opaque member object. * @param req Enrollment request * @param {string} req.enrollmentID The registered ID to use for enrollment * @param {string} req.enrollmentSecret The secret associated with the enrollment ID * @returns Promise for an object with "key" for private key and "certificate" for the signed certificate */ enroll(req) { console.log("test"); var self = this;

I restart command:

node test/integration/e2e/create-channel.js

but no "test" on my console. Can somebody help me to sovle this problem? Thanks

Gxz-NGU avatar Aug 02 '18 07:08 Gxz-NGU

Just make sure you have the correct images and you can build network with correct number of images.

Gxz-NGU avatar Aug 09 '18 07:08 Gxz-NGU