-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid yaml definition in trade-finance-logistics/network/configtx.yaml #36
Comments
What version of Fabric are you using? This code was built and tested for |
@VRamakrishna , please read the error message carefully, it complains about the wrong format of the yaml file, and i have tested the yaml file using Python and using https://codebeautify.org/yaml-validator too, all of them prompted similar error,
|
I understood the error message. And yes, the YAML file is not in a standard format: some parsers fail (I remember JavaScript parsers failing, and you point out that your Python parser is reporting an error too), but I also remember that parsing in Golang worked. Luckily, you don't have to explicitly parse the file using a third-party parser. The I know for a fact that this YAML file fails to parse if you use a tool built from |
@VRamakrishna , thank you for your explanation |
OK, that's good, but just to be clear, I was referring to the branches of the Fabric source: https://github.com/hyperledger/fabric/. It has branches named release-1.1, release-1.2, etc. Not sure exactly what 1.2.1 refers to (is that the fabric-client npm package)? Also, there's no guarantee that the rest of the code (middleware and application) will work with 1.2. I spent a little bit of time porting the network part (involved changing the YAML file, as you've experienced), but the Javascript failed. I'll return to that project when I get time. So, just to reiterate, if you want the code in this repo to work, use the release-1.1 branches of the source code. Otherwise, if you are experimenting, go right ahead. Good luck! |
Hi @VRamakrishna , i checked it again, i am using release-1.2. sorry for the wrong info. |
You are free to try out the migration by forking the code base. If you want to merge your changes, submit a pull request (though be warned that I may not get to it immediately; I'll have to spend time reviewing and testing it out.) |
When i run configtxgen to generate genesis block i encountered the following errors
ubuntu@ubuntu:~/go/src/trade-finance-logistics/network$ configtxgen -profile FourOrgsTradeOrdererGenesis -outputBlock ./channelartifacts/genesis.block
2018-08-30 01:58:27.690 EDT [common/tools/configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen is deprecated. Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
2018-08-30 01:58:27.690 EDT [common/tools/configtxgen] main -> INFO 002 Loading configuration
2018-08-30 01:58:27.691 EDT [common/tools/configtxgen/localconfig] Load -> CRIT 003 Error reading configuration: While parsing config: yaml: unknown anchor 'ChannelCapabilities' referenced
2018-08-30 01:58:27.691 EDT [common/tools/configtxgen] func1 -> CRIT 004 Error reading configuration: While parsing config: yaml: unknown anchor 'ChannelCapabilities' referenced
panic: Error reading configuration: While parsing config: yaml: unknown anchor 'ChannelCapabilities' referenced [recovered]
panic: Error reading configuration: While parsing config: yaml: unknown anchor 'ChannelCapabilities' referenced
goroutine 1 [running]:
github.com/hyperledger/fabric/vendor/github.com/op/go-logging.(*Logger).Panic(0xc4201abe00, 0xc42039dd00, 0x1, 0x1)
/home/ubuntu/go/src/github.com/hyperledger/fabric/vendor/github.com/op/go-logging/logger.go:188 +0xbd
main.main.func1()
/home/ubuntu/go/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:254 +0x1ae
panic(0xc6ea00, 0xc42039dcf0)
/usr/lib/go-1.10/src/runtime/panic.go:505 +0x229
github.com/hyperledger/fabric/vendor/github.com/op/go-logging.(*Logger).Panic(0xc4201abc50, 0xc4201a57a0, 0x2, 0x2)
/home/ubuntu/go/src/github.com/hyperledger/fabric/vendor/github.com/op/go-logging/logger.go:188 +0xbd
github.com/hyperledger/fabric/common/tools/configtxgen/localconfig.Load(0x7ffd1ef6d6d8, 0x1b, 0x0, 0x0, 0x0, 0x1)
/home/ubuntu/go/src/github.com/hyperledger/fabric/common/tools/configtxgen/localconfig/config.go:277 +0x469
main.main()
/home/ubuntu/go/src/github.com/hyperledger/fabric/common/tools/configtxgen/main.go:265 +0xce7
And after digging deeper, i thought it was caused by the wrong yaml definition, we used alias ChannelCapabilities before anchor ChannelCapabilities, so the parser thought it was invalid, and the following are the yaml specification about Anchor and Alias
And if we move the Profiles's definition to the bottom of the file, then it will be considered as a valid yaml file, and configtxgen succeed.
The text was updated successfully, but these errors were encountered: