Error when reading core config file: Unsupported Config Type
Asked Answered
P

4

6

I am trying to pass in the channel configuration transaction artifact to the order-er using the command:

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

But I get an error:

2018-03-17 20:55:21.380 GMT [main] main -> ERRO 001 Fatal error
 when initializing core config : error when reading core 
config file: Unsupported Config Type ""

What does this error mean? and how can I fix it?

Using docker ps -a

CONTAINER ID        IMAGE                                                                                                    COMMAND                  CREATED             STATUS                       PORTS                                              NAMES
5c27fce33911        hyperledger/fabric-tools:latest                                                                          "/bin/bash"              3 minutes ago       Up 3 minutes                                                                    cli
aabf72f81352        hyperledger/fabric-peer:latest                                                                           "peer node start"        3 minutes ago       Up 3 minutes                 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp     peer0.org1.example.com
73ddcafb5ce6        hyperledger/fabric-orderer:latest                                                                        "orderer"                3 minutes ago       Up 3 minutes                 0.0.0.0:7050->7050/tcp                             orderer.example.com
205448f5479a        hyperledger/fabric-peer:latest                                                                           "peer node start"        3 minutes ago       Up 3 minutes                 0.0.0.0:8051->7051/tcp, 0.0.0.0:8053->7053/tcp     peer1.org1.example.com
4e5ba2999f54        hyperledger/fabric-peer:latest                                                                           "peer node start"        3 minutes ago       Up 3 minutes                 0.0.0.0:9051->7051/tcp, 0.0.0.0:9053->7053/tcp     peer0.org2.example.com
fcc6b25b6422        hyperledger/fabric-peer:latest                                                                           "peer node start"        3 minutes ago       Up 3 minutes                 0.0.0.0:10051->7051/tcp, 0.0.0.0:10053->7053/tcp   peer1.org2.example.com
2f1536ffe265        dev-peer0.org1.example.com-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba   "chaincode -peer.add…"   24 hours ago        Exited (255) 3 minutes ago                                                      dev-peer0.org1.example.com-fabcar-1.0
6ae48101bc34        hyperledger/fabric-ca                                                                                    "sh -c 'fabric-ca-se…"   24 hours ago        Exited (255) 3 minutes ago   0.0.0.0:7054->7054/tcp                             ca.example.com
dc9e5bb3cc8e        hyperledger/fabric-couchdb                                                                               "tini -- /docker-ent…"   24 hours ago        Exited (255) 3 minutes ago   4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp         couchdb

this is the log of orderer.example.com enter image description here

Peephole answered 17/3, 2018 at 20:57 Comment(10)
to find the logs you can first do docker ps -a and then docker logs container idDuration
I have added the log of orderer.example.com,also added docker ps -a at the end of the question.Hope this helps and sorry for the late reply.Peephole
Well your ca.example.com is already down and it has to be up and running.Duration
how do I fix that?Peephole
I don't have permanent solution but remove -d flag while spinning up the docker containers.Duration
removing -d just shows the logsPeephole
docker-compose -f $COMPOSE_FILE -f $COMPOSE_FILE_COUCH -f $CA_FILE upDuration
go in the folder where you have configuration files and type FABRIC_CFG_PATH=$PWD. thats the only 2 reason that you can have this type of error. i dont see any other reason why there is config issue. or may be there is type in your configuration file.Duration
Is it because I forgot to specify env variables?CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp CORE_PEER_ADDRESS=peer0.org1.example.com:7051 CORE_PEER_LOCALMSPID="Org1MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crtPeephole
Nice, that what this error was all about missing something in config file :). Glad you found the solutionDuration
V
6

You should be inside the CLI container to execute the peer channel create command.

You will enter the CLI container using the docker exec command:

docker exec -it cli bash

If successful you should see the following:

root@0d78bb69300d:/opt/gopath/src/github.com/hyperledger/fabric/peer#

Over there, you should run the peer channel create command like this:

root@0d78bb69300d:/opt/gopath/src/github.com/hyperledger/fabric/peer# 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

Before running this command, please note that you should also run commands for creating environment variables for CHANNEL_NAME and other Environment variables for PEER0 within this CLI Container.

Vaulting answered 21/8, 2018 at 4:36 Comment(0)
D
3

export FABRIC_CFG_PATH=$PWD. it will resolve this issue.

Duration answered 20/3, 2018 at 17:49 Comment(5)
I did that but doesn't seem to fix it.Peephole
can you please add the logs for orderer.example.comDuration
how can I find the logs? sorry I am kinda new to this.Peephole
I think the problem is that in the tutorial where I build my first network I got to the part where I start the network and there is a command which i didnt do because i don't understand how it works: working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peerPeephole
I tried to ignore export FABRIC_CFG_PATH=$PWD and use the command line option "-configPath ./configtx.yaml" which seems like it should work. cryptogen supports command line option for crypto-config.yamlCircinus
S
3

This is the error you get when the core.yaml is not found. Like the Mukesh mentioned above, running command within the CLI Container will not throw the Error.

See this link for more detail.

Safeguard answered 29/10, 2018 at 3:42 Comment(0)
C
2

Can you try running this command: echo $FABRIC_CFG_PATH

Whatever value you get, can you navigate to that directory and confirm if you can see the configtx.yaml file in there.

From the docs here, it says the error is as a result of inappropriately setting the value of that variable.

Clerissa answered 27/3, 2018 at 21:48 Comment(1)
I exported FABRIC_CFG_PATH in /c/Users/$name/fabric-samples/first-network and configtx.yaml is in that folder so I don't know what the problem could be.Peephole

© 2022 - 2024 — McMap. All rights reserved.