marbles: Failed to install chaincode on local network - error "This identity is not an admin"

I am following the guide and use local network, I create the admin cert by fabric-sample/fabcar’s 3 scripts and it works right.

The version I am using: Node 6.9.5 Hyperledger: latest I think, as I setup it from the prerequisites tutorial

But when I try to install chain code, it gives me below error message.

Lius-MacBook-Pro:scripts jeremy$ node install_chaincode.js
info: Loaded config file /Users/jeremy/Programming/github/marbles/config/marbles_local.json
info: Loaded creds file /Users/jeremy/Programming/github/marbles/config/blockchain_creds_local.json
---------------------------------------
info: Lets install some chaincode - marbles v4
---------------------------------------
info: First we enroll
info: [fcw] Going to enroll with admin cert!  peer_urls=[grpc://localhost:7051], channel_id=mychannel, uuid=marbles-Docker Compose Network-mychannel-fabric-peer-org1, orderer_url=grpc://localhost:7050, msp_id=Org1MSP
debug: added peer grpc://localhost:7051
debug: [fcw] Successfully got enrollment marbles-Docker Compose Network-mychannel-fabric-peer-org1
---------------------------------------
info: Now we install
---------------------------------------
debug: [fcw] Installing Chaincode
debug: [fcw] Sending install req targets=[grpc.http2.keepalive_time=300, grpc.keepalive_time_ms=300000, grpc.http2.keepalive_timeout=35, grpc.keepalive_timeout_ms=3500, grpc.primary_user_agent=grpc-node/1.10.0, _url=grpc://localhost:7051, addr=localhost:7051, , _request_timeout=90000, , _name=null], chaincodePath=marbles, chaincodeId=marbles, chaincodeVersion=v4
info: [packager/Golang.js]: packaging GOLANG from marbles
error: [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 2 UNKNOWN: chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
    at new createStatusError (/Users/jeremy/Programming/github/marbles/node_modules/grpc/src/client.js:64:15)
    at /Users/jeremy/Programming/github/marbles/node_modules/grpc/src/client.js:583:15
error: [fcw] Failed to obtain endorsement for transaction. code=2, , details=chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
error: [fcw] Error in install catch block object code=2, , details=chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creatorsatisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))
---------------------------------------
info: Install done. Errors: parsed=Blockchain network error - [This identity is not an admin])), raw=[code=2, , details=chaincode error (status: 500, message: Authorization for INSTALL has been denied (error-Failed verifying that proposal's creator satisfies local MSP principal during channelless check policy with policy [Admins]: [This identity is not an admin]))]
---------------------------------------

I tried to debug, and the certificate I get is the admin’s certification.

I am new to hyperledger, I don’t know why it complains the [This identity is not an admin])).

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 38 (5 by maintainers)

Most upvoted comments

The same problem…

@kgamal i got the same problem, but i’ve fixed it.

please copy /home/ibmadmin/fabric-samples/fabcar/hfc-key-store to your home directory $HOME/.hfc-key-store

then change connection_profile_local.json attr client.credentialStore.path value to $HOME/.hfc-key-store.

https://jira.hyperledger.org/browse/FAB-2593

I’m experimenting a weird behavior. Copying the admincerts cert of an admin member to the admincerts folder of my peer make it works. BUT, I’m not a big fan of copying stuff from docker instances. I tried to enroll the admin member inside my peer node docker instance, with an msp folder set to /tmp, then I copy the signcerts cert file generated into the msp admincert folder of the peer, and then start the peer. It does not work. The same This identity is not an admin error appears though it is an admin. The admincerts generated with this method hardly the same as the one copied except for serial and some public signatures due to a new enroll.

Am I missing something? Are we doomed to copy an admincertfile from the outside? Is it possible to directly register a peer with admin rights (or an admincert folder automatically generated)?

EDIT, just found out, from this code: https://github.com/hyperledger/fabric-sdk-go/blob/master/internal/github.com/hyperledger/fabric/msp/mspimpl.go#L460

The admin cert need to be exactly the same as the admin cert used to make the query. As mine is different, since I reenroll the admin, it could not work. Copying seems to be the only way (either GET from a web API) or using a binded volume.

@Ksloveyuan fabcar is not the the repo that needs to be cleaned. you need to pull changes on the marbles repo. So from the marbles directory type git pull to get the latest changes. make sure the command says it updated some files and there were no issues merging the changes. you may run into merge conflicts if you have been modifying files… you can either resolve those yourself or if all else fails, delete the marbles folder and clone it again. that’s kind of a last resort. just depends how familiar you are with git.

@WuCh1k1n great! thanks for reporting back.