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

Chaincode installation fails #237

Closed amayjha closed 5 years ago

amayjha commented 6 years ago

I am trying to install chaincode on my mac and it fails with error connecting to http1.x server:

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://127.0.0.1:7054, addr=127.0.0.1:7054, , _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: Trying to connect an http1.x server at new createStatusError (/Users/amayjha/marbles/node_modules/grpc/src/client.js:64:15) at /Users/amayjha/marbles/node_modules/grpc/src/client.js:583:15 error: [fcw] Failed to obtain endorsement for transaction. code=14, , details=Trying to connect an http1.x server error: [fcw] Error in install catch block object code=14, , details=Trying to connect an http1.x server

info: Install done. Errors: parsed=Blockchain network error - Trying to connect an http1.x server, raw=[code=14, , details=Trying to connect an http1.x server]

dshuffma-ibm commented 6 years ago

have you ran the test network commands? step 4 in the local hyperledger setup doc

my hunch is that either your connection profile (JSON in the ./config/ folder ) is not pointing to the right addresses or something is off with your fabric network.

amayjha commented 6 years ago

Thanks @dshuffma-ibm for your response. I actually went through those steps and got success message response.

I have updated the localhost to 0.0.0.0 and changed $HOME to absolute path to fix some of the errors i was facing earlier. I get a 404 not found error when i try to use http://0.0.0.0:7054 url. Below is my connection_profile_local.json file. Do you see anything wrong it?

{ "name": "Docker Compose Network", "x-networkId": "not-important", "x-type": "hlfv1", "description": "Connection Profile for an Hyperledger Fabric network on a local machine", "version": "1.0.0", "client": { "organization": "Org1MSP", "credentialStore": { "path": "/Users/amayjha/.hfc-key-store" } }, "channels": { "chaincode": { "orderers": [ "fabric-orderer" ], "peers": { "fabric-peer-org1": { "x-chaincode": {} } }, "chaincodes": [ "marbles:v4" ], "x-blockDelay": 10000 } }, "organizations": { "Org1MSP": { "mspid": "Org1MSP", "peers": [ "fabric-peer-org1" ], "certificateAuthorities": [ "fabric-ca" ], "x-adminCert": { "path": "/Users/amayjha/marbles/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/admincerts/Admin@org1.example.com-cert.pem" }, "x-adminKeyStore": { "path": "/Users/amayjha/marbles/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/" } } }, "orderers": { "fabric-orderer": { "url": "grpc://0.0.0.0:7050" } }, "peers": { "fabric-peer-org1": { "url": "grpc://0.0.0.0:7054", "eventUrl": "grpc://0.0.0.0:7053" } }, "certificateAuthorities": { "fabric-ca": { "url": "http://0.0.0.0:7054", "httpOptions": { "verify": true }, "registrar": [ { "enrollId": "admin", "enrollSecret": "adminpw" } ], "caName": null } } }

dshuffma-ibm commented 6 years ago

The 404 is benign and your json looks fine. can you describe your setup? ie what OS, is the fabric running locally, or in a VM? and with your latest 0.0.0.0 changes do you still get the same error you originally posted?

also double check all the containers are running with docker ps. should see a chaincode container for fabcar, 1 peer, 1 orderer, 1 ca, and 1 couchdb container all running. right now you are having trouble with the CA. there might be logs there to see. docker logs -f <container name of the ca here> and then re-run the install to generate new logs.

dshuffma-ibm commented 5 years ago

closing, inactivity