0
votes

I am following below tutorial

https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.html

I am able to complete the steps till setting up default wallet identity. After this when i try system ping method I get the error.

{
  "error": {
    "statusCode": 500,
    "name": "Error",
    "message": "Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:maeid1)",
    "stack": "Error: Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:maeid1)\n    at _checkRuntimeVersions.then.catch (/home/praval/.nvm/versions/node/v6.11.1/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:696:34)"
  }
}

The same error I get while testing from access token.

curl -v http://localhost:3000/api/system/ping?access_token=xxxxx

Though I can run network ping successfully.

composer network ping -p hlfv1 -n 'digitalproperty-network' -i maeid1 -s NfUhmXtiaSUH

Thanks for help.

1

1 Answers

0
votes

The problem you are seeing is described by this issue https://github.com/hyperledger/composer/issues/1761

Both the CLI and Rest server have enrolled the user but this results in both environments storing certificates for the same identity that differ (for example issue and expiry dates). Whichever environment used their certificate first for that identity and activated that identity/participant in the runtime has their certificate registered. When the other environment presents their certificate it isn't found (because it is different to the first environment) and so reports that the identity is not registered.

The way to address this is if you plan to use the identity in the rest server, don't ping it from the CLI first.