Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

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

Open
Gxz-NGU opened this issue Aug 2, 2018 · 1 comment

Comments

@Gxz-NGU
Copy link

Gxz-NGU commented Aug 2, 2018

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
Copy link
Author

Gxz-NGU commented Aug 9, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant