Louis Syropoulo
Louis Syropoulo

Reputation: 11

failed to load certificates while trying to create channel following Hyperledger Fabric 'First Network' Tutorial

I am following the tutorial on Windows 10 pro and have come across no other issues. I can even run ./byfn.sh up successfully.

When following the rest of the tutorial and trying to create a channel with:

peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -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

I get the following error:

*Failed loading OrdererOU certificate at 
[/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/cacerts\ca.org1.example.com-cert.pem]: [could not read file /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/cacerts\ca.org1.example.com-cert.pem: open /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp/cacerts\ca.org1.example.com-cert.pem: invalid argument]*

The error seems to be coming from the '\' in '\ca.org1.example.com-cert.pem'.

This seems to be an issue with linux system paths mixed with windows system paths but im not sure how I should go about modifying the path manually as I can not find any configuration that tells Fabric where to look for the certificates.

Upvotes: 1

Views: 748

Answers (1)

Pierre-Henri Debris
Pierre-Henri Debris

Reputation: 138

I ran into the same issue on my current project and I'm guessing this is an issue with Cryptogen tool (on a previous project, it wasn't happening)

To fix this i'm using this command:

  find ./crypto-config -type f -name "config.yaml" -exec sed -i 's/\\/\//g' {} \;

The command look for all 'config.yaml' file in the subfolders of the crypto-config folder and replace all '\' to '/'

The error doesn't happen when i'm generating the certificates using the default crypto-config.yaml of the first-network sample.

I don't know why this is happening when crypto-config.yaml is modified.

Upvotes: 2

Related Questions