Reputation: 939
Im trying to run the latest Fabric 1.4 Fabcar on my local machine. Iv installed the prerequisites cleaned down docker images and run the following commands
fabric-samples/fabcar: ./startFabric.sh java
I can see the chaincode being installed on the peers but once it reaches the channel I get the following error
`Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 254'
Iv also tried
./startFabric.sh javascript and ./startFabric.sh
But I get the same result. I was able to run and query '''first-network''' ok, but cannot get Fabcar started :(
Also If I do an mvn test from the java app I get
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException:
org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock
for channel mychannel failed with peer peer0.org1.example.com. Status
FAILURE, details: Channel Channel{id: 1, name: mychannel} Sending
proposal with transaction:
e545101510caaf0cbb9ff5e193b648308a93e53a459599c2d85f2cd9d4f181bc to
Peer{ id: 2, name: peer0.org1.example.com, channelName: mychannel, url:
grpcs://localhost:7051, mspid: Org1MSP} failed because of: gRPC
failure=Status{code=UNKNOWN, description=access denied: channel
[mychannel] creator org [Org1MSP], cause=null}
Any help appreciated
Startup logs
Installing smart contract on peer1.org2.example.com
+ docker exec -e CORE_PEER_LOCALMSPID=Org2MSP -e CORE_PEER_ADDRESS=peer1.org2.example.com:10051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt cli peer chaincode install -n fabcar -v 1.0 -p /opt/gopath/src/github.com/chaincode/fabcar/java -l java
2019-10-21 19:59:41.619 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-10-21 19:59:41.619 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-10-21 19:59:42.006 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >
+ echo 'Instantiating smart contract on mychannel'
Instantiating smart contract on mychannel
+ docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l java -v 1.0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
2019-10-21 19:59:42.387 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-10-21 19:59:42.388 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1```
docker ps -a
```CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
44d6dd0274cb hyperledger/fabric-tools:latest "/bin/bash" 6 minutes ago Up 6 minutes cli
ff7b5068437e hyperledger/fabric-peer:latest "peer node start" 6 minutes ago Up 6 minutes 0.0.0.0:7051->7051/tcp peer0.org1.example.com
5806c85ba8b7 hyperledger/fabric-peer:latest "peer node start" 6 minutes ago Up 6 minutes 0.0.0.0:9051->9051/tcp peer0.org2.example.com
fd722bc9df2d hyperledger/fabric-peer:latest "peer node start" 6 minutes ago Up 6 minutes 0.0.0.0:10051->10051/tcp peer1.org2.example.com
9031600fe52a hyperledger/fabric-peer:latest "peer node start" 6 minutes ago Up 6 minutes 0.0.0.0:8051->8051/tcp peer1.org1.example.com
69c4f20893e8 hyperledger/fabric-orderer:latest "orderer" 6 minutes ago Up 6 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
8325f89e702a hyperledger/fabric-couchdb "tini -- /docker-ent…" 6 minutes ago Up 6 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb0
7d83b2cff3c3 hyperledger/fabric-couchdb "tini -- /docker-ent…" 6 minutes ago Up 6 minutes 4369/tcp, 9100/tcp, 0.0.0.0:8984->5984/tcp couchdb3
0a94844d9fe4 hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 6 minutes ago Up 6 minutes 0.0.0.0:7054->7054/tcp ca_peerOrg1
1da63403427f hyperledger/fabric-ca:latest "sh -c 'fabric-ca-se…" 6 minutes ago Up 6 minutes 7054/tcp, 0.0.0.0:8054->8054/tcp ca_peerOrg2
9e3ece2b615a hyperledger/fabric-couchdb "tini -- /docker-ent…" 6 minutes ago Up 6 minutes 4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp couchdb2
91e08de9c145 hyperledger/fabric-couchdb "tini -- /docker-ent…" 6 minutes ago Up 6 minutes 4369/tcp, 9100/tcp, 0.0.0.0:6984->5984/tcp couchdb1```
Upvotes: 1
Views: 1790
Reputation: 939
So the solution to get past the java.net.UnknownHostException
issue which was the root problem to the question was to change the system host file in /etc/hosts by adding the following...
127.0.0.1 orderer.example.com
127.0.0.1 peer1.org1.example.com
127.0.0.1 peer0.org2.example.com
127.0.0.1 peer0.org1.example.com
127.0.0.1 peer1.org2.example.com
127.0.0.1 ca_peerOrg1
127.0.0.1 ca_peerOrg2
127.0.0.1 couchdb1
127.0.0.1 couchdb2
127.0.0.1 couchdb3
127.0.0.1 couchbd0
mvn test worked then :) Hope this helps others
Upvotes: 0
Reputation: 41
there might be lots of reason for the failure either there would be incorrect path setup or chaincode installed peer might not be accessible.
can you try out by using these commands and try to spin up again
docker kill $(docker ps -q) docker rm $(docker ps -aq) docker rmi $(docker images dev-* -q)
Upvotes: 4