IBM-Blockchain-Archive / marbles

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Apache License 2.0
1.03k stars 979 forks source link

Error : [client-utils.js]: sendPeersProposal - Promise is rejected: Error: 14 UNAVAILABLE #225

Closed sujayisiri closed 6 years ago

sujayisiri commented 6 years ago

Trying to setup marbles application locally and encountered this error when tried to install the chaincode Steps followed:

  1. Cloned the fabric-samples first and installed all the necessary node modules and got the CA Cert for Admin and User and also tested the fabcar sample app with node query.js and got the output properly.
  2. Cloned the marbles app from github
  3. cd marbles
  4. sudo npm install : got the error for Error: EACCES: permission denied on a pkcs11js but fixed it with sudo npm install pkcs11js --unsafe-perm=true --allow-root as mentioned in the fabric-samples setup document.
  5. sudo npm install
  6. cd ./scripts
  7. node install_chaincode.js : got the error
    
    throw err;
    ^

Error: Cannot find module 'fabric-ca-client/lib/FabricCAClientImpl.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at module.exports (/Volumes/D Drive/Gitlab/marbles/utils/fc_wrangler/parts/enrollment.js:11:18) at module.exports (/Volumes/D Drive/Gitlab/marbles/utils/fc_wrangler/index.js:10:51) at Object. (/Volumes/D Drive/Gitlab/marbles/scripts/install_chaincode.js:35:73) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32)

but fixed the above error by ```sudo npm install fabric-ca-client```

then again tried node install_chaincode.js but got this error:

```---------------------------------------
info: Lets install some chaincode - marbles v4
---------------------------------------
info: First we enroll
debug: loading pem from a path: /Volumes/D Drive/Gitlab/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/cd96d5260ad4757551ed4a5a991e62130f8008a0bf996e4e4b84cd097a747fec_sk
debug: loading pem from a path: /Volumes/D Drive/Gitlab/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem
info: [fcw] Going to enroll with admin cert!  peer_urls=[grpc://localhost:7051], channel_id=mychannel, uuid=marblesDockerComposeNetworkmychannelOrg1MSPfabricpeerorg1, orderer_url=grpc://localhost:7050, msp_id=Org1MSP
debug: added peer grpc://localhost:7051
debug: [fcw] Successfully got enrollment marblesDockerComposeNetworkmychannelOrg1MSPfabricpeerorg1
---------------------------------------
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.max_receive_message_length=-1, grpc.max_send_message_length=-1, grpc.primary_user_agent=grpc-node/1.10.1, _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: 14 UNAVAILABLE: Connect Failed
    at new createStatusError (/Volumes/D Drive/Gitlab/marbles/node_modules/grpc/src/client.js:64:15)
    at /Volumes/D Drive/Gitlab/marbles/node_modules/grpc/src/client.js:583:15
error: [fcw] Failed to obtain endorsement for transaction. code=14, , details=Connect Failed
error: [fcw] Error in install catch block object code=14, , details=Connect Failed
---------------------------------------
info: Install done. Errors: parsed=Blockchain network error - Connect Failed, raw=[code=14, , details=Connect Failed]

Please suggest what to do..