1

I was running Hyperleddger byfn, to bring up the first network, on Mac. Each time I got this error above. What I tried so far for resolutio:

docker rm -f $(docker ps -aq) — del existing containers docker rmi -f $(docker images -a) — del existing images ./byfn.sh -m down ./byfn.sh -m generate ./byfn.sh -m up

But I keep getting the same error. Also tried executing the command line in byfn script - where the error is generated, separately on docker cli

docker exec cli peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /Users/debg/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

Error: failed to create deliver client: failed to load config for OrdererClient: unable to load orderer.tls.rootcert.file: open /Users/debg/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem: no such file or directory

But I can clearly see the .pem file on the same folder, with 755 access through all the directories in the hierarchy and the file. Can anyone please help?

DebG
  • 11
  • 1

1 Answers1

0

The given path: /Users/debg/fabric-samples/first-network/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem is checked inside your cli docker container.

Can you please confirm if the certificate is correctly getting mounted to that location inside the cli container?

Chintan Rajvir
  • 689
  • 6
  • 20
  • The file is certainly there in the folder. What's the definition of correctly mounted? – DebG Jun 10 '20 at 10:48
  • You must check that the "file" present inside the docker container at the specified path. Do a `docker exec -it cli bash` following by navigating to above specified location. Can you find that file inside the container? – Chintan Rajvir Jun 10 '20 at 12:24
  • Ok, so it's not there. So what's the next step? I have repeatedly tried to restart the server, didn't work. – DebG Jun 12 '20 at 17:40
  • You can check inside the `cli` container where the file is, by using `find / -name "tlsca.example.com-cert.pem"` and try to manually run the above command inside the `cli` container. – Chintan Rajvir Jun 13 '20 at 05:03
  • I executed and got the path below: /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem So, I redefined the ORDERER_CA variable in script.sh with this path and rerun. Now I am getting the error below even if the command is picking up the correct path for CA file. InitCmd -> ERRO 002 Cannot run peer because cannot init crypto, folder "/Users/debg/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" does not exist – DebG Jun 14 '20 at 21:20
  • I would advise you to clone the fabric-samples repository again and test with initial environment. Once that works fine, you can make changes to script thereafter. – Chintan Rajvir Jun 15 '20 at 03:00
  • I did, got a different error:: + peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --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 + res=1 + set +x Error: failed to create deliver client for orderer: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup orderer.example.com on 127.0.0.11:53: no such host" – DebG Jun 17 '20 at 19:44