hyperledger / fabric-samples

Samples for Hyperledger Fabric
https://wiki.hyperledger.org/display/fabric
Apache License 2.0
2.75k stars 3.34k forks source link

2022-08-13 09:01:17.971 UTC 0001 ERRO [main] InitCmd -> Fatal error when initializing core config : FABRIC_CFG_PATH /etc/hyperledger/peercfg does not exist #814

Open 451735773 opened 1 year ago

451735773 commented 1 year ago

When I use the latest version of fabric2.4, I try to add a new peer under rog1, and then add a new container in docker compose. However, an error is reported when I start it. Does anyone tell me the reason and how to solve it? image image

ArpanaGupta commented 1 year ago

Hello,

I also ran into same issue while testing addOrg functionality under fabric-samples/test-network. The problem location: FABRIC_CFG_PATH=/etc/hyperledger/peercfg

Actually, etc/hyperledger/peercfg is not mapped to any volume on local machine. So, if we map this location to a location in our local env and it should have core.yaml file present (Information of the new peer that is to be added), then it works. Before creating container for peer, do make sure you have your relevant certs present under mapped msp folder.

Hope that helps.

osazeejedi commented 1 year ago

Hello,

i ran into this error while trying to install fabric-chaincode-evm on fabric 2.4...

can someone help with this

Screenshot 2022-09-14 at 13 15 52
ArpanaGupta commented 1 year ago

Can you check your docker compose file which has service to create peer node container. As we set env variable FABRIC_CFG_PATH at the time of container creation. There may be a - FABRIC_CFG_PATH=/etc/hyperledger/peercfg under environment section of peer node service. We need to map the "/etc/hyperledger/peercfg" to a location in host machine that has core.yaml.

For your reference, similar way setting fabric config path can be seen in docker compose files in fabric-samples. There, we have 2 sets of compose file. one is base compose file where under peer container service FABRIC_CFG_PATH as /etc/hyperledger/peercfg is set as env variables. And other extension/child compose file that has mapping of "/etc/hyperledger/peercfg" to an actual location on the host machine. You can refer to compose files present in "https://github.com/hyperledger/fabric-samples/tree/main/test-network/addOrg3/compose"

Then we use following command to create our containers docker-compose -f base_compose_file -f child_compose_file up -d

kangkang333 commented 1 year ago

I also ran into this error, but I am a little confused about the above answer, I don't know how to solve it operational