Channel creation failed. Hyperledger-fabric - hyperledger-fabric

This is on a ubuntu 18.04 VPS
$ docker version
Client: Docker Engine - Community
Version: 20.10.8
API version: 1.41
Go version: go1.16.6
Git commit: 3967b7d
Built: Fri Jul 30 19:54:08 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.8
API version: 1.41 (minimum version 1.12)
Go version: go1.16.6
Git commit: 75249d8
Built: Fri Jul 30 19:52:16 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.9
GitCommit: e25210fe30a0a703442421b0f60afac609f950a3
runc:
Version: 1.0.1
GitCommit: v1.0.1-0-g4144b63
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$docker-compose version
docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f 25 May 2017
LOCAL_VERSION=2.2.4
DOCKER_IMAGE_VERSION=2.2.4
I ran:
$./network.sh up (This is succesfull)
$./network.sh createChannel
But send me this.
neek_test#localhost:~/go/src/github.com/neek_test/fabric-samples/test-network$ ./network.sh createChannel
Creating channel 'mychannel'.
If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb
Generating channel genesis block 'mychannel.block'
/home/neek_test/go/src/github.com/neek_test/fabric-samples/test-network/../bin/configtxgen
configtxgen -profile TwoOrgsApplicationGenesis -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel
2021-09-22 18:10:24.039 CDT [common.tools.configtxgen] main -> INFO 001 Loading configuration
2021-09-22 18:10:24.059 CDT [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
2021-09-22 18:10:24.059 CDT [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216
2021-09-22 18:10:24.059 CDT [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: /home/neek_test/go/src/github.com/neek_test/fabric-samples/test-network/configtx/configtx.yaml
2021-09-22 18:10:24.062 CDT [common.tools.configtxgen] doOutputBlock -> INFO 005 Generating genesis block
2021-09-22 18:10:24.062 CDT [common.tools.configtxgen] doOutputBlock -> WARN 006 Genesis block does not contain a consortiums group definition. This block cannot be used for orderer bootstrap.
2021-09-22 18:10:24.062 CDT [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
res=0
Creating channel mychannel
Using organization 1
Error: Post "https://localhost:7053/participation/v1/channels": read tcp 127.0.0.1:42722->127.0.0.1:7053: read: connection reset by peer
Channel creation failed.
What could I do? Thank you.

I've been attempting to recreate your error but haven't been able to. It seems that configtxgen is successfully creating a genesis block for your channel, however osnadmin cannot join the first orderer to the channel.
Can you provide more context to your question? What version of Fabric are you using? Have you messed with any of the configuration yaml files in the test network?
If you are simply trying to run the test network tutorial, you can always wipe your local repositories and fetch the newest versions of the fabric and fabric-samples repositories then try again. Also, this link might be of use for helping you understanding the updated, "system channel-less" way of how the configtxgen and osnadmin binaries work together to create an application channel.

Related

Upgrading chaincode in hyperledger fabric gives no errors, but doesn't reflect changes

I'm trying to update a chaincode with a 3 nodes blockchain using Hyperledger Fabric 1.4.4, raft and multi ordering.
I'm using ansible to deploy the BC : https://github.com/Altoros/Ansible-Fabric-Starter
What I'm trying to do is upgrading the chaincode.
I first log in the cli container in a node:
ubuntu#ip-172-31-46-199:~$ docker exec -it cli.org0.domain bash
root#56e6868e66a0:/etc/hyperledger/artifacts# export CORE_PEER_ADDRESS=peer0.org0.domain:7051 && peer chaincode install -n main -v 1.0.1 -p main -l golang
2021-03-18 16:54:45.475 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-03-18 16:54:45.475 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2021-03-18 16:54:47.599 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >
root#56e6868e66a0:/etc/hyperledger/artifacts# export CORE_PEER_ADDRESS=peer0.org0.domain:7051 && peer chaincode upgrade -n main -v 1.0.1 -c "{\"Args\":[\"GetMeasuresBetween\",\"2019-03-29T12:00:00Z\", \"2019-03-29T14:00:00Z\"]}" -o orderer2.domain:7050 -C org0 --tls --cafile /etc/hyperledger/artifacts/crypto-config/ordererOrganizations/domain/tlsca/tlsca.domain-cert.pem
2021-03-18 17:03:09.896 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-03-18 17:03:09.897 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Everything seems to be working.
But when I try to invoke the chaincode where I changed a debug message
peer chaincode invoke --cafile /etc/hyperledger/artifacts/crypto-config/ordererOrganizations/domain/tlsca/tlsca.domain-cert.pem --tls -o orderer2.domain:7050 -C org0 -n main -c "{\"Args\":[\"AddMeasure\",\"ACC00000000\",\"23547901584620111112\",\"Conso\",\"BASE\",\"1010\",\"2019-11-01T08:30:01Z\"]}"
it is also working well, but I cannot see in the logs the new debug message, only seeing old one.
Is it something I am missing ? When invoking the chaincode, will it always take the latest version ?
After you install the new version on each peer, you need to then perform an upgrade operation (analogous to doing install and instantiate when you deployed the initial version of the chaincode).

Running Fabcar example returns error: failed to endorse chaincode install

I am on Ubuntu 19.10, installed all the pre-requisites and have downloaded the fabric-samples git repository.
I am following the tutorial on this link
I ran the first-network example and it worked fine. Now, when I am trying to run the fabcar example by running the command ./startFabric.sh javascript, I am getting the following error:
...
2020-02-02 23:51:14.534 UTC [msp.identity] Sign -> DEBU 02c Sign: digest: 8A36B905991D6B72A6F487E93C79D468A35F402D6EB4F51E3323152A03A5B64E
2020-02-02 23:53:04.531 UTC [grpc] infof -> DEBU 02d Client received GoAway with http2.ErrCodeEnhanceYourCalm.
2020-02-02 23:53:04.531 UTC [grpc] HandleSubConnStateChange -> DEBU 02e pickfirstBalancer: HandleSubConnStateChange: 0xc0003e1620, CONNECTING
2020-02-02 23:53:04.531 UTC [grpc] infof -> DEBU 02f transport: loopyWriter.run returning. connection error: desc = "transport is closing"
Error: failed to endorse chaincode install: rpc error: code = Unavailable desc = transport is closing
It looks like the error is generated when it executed:
docker exec -e CORE_PEER_LOCALMSPID=Org2MSP -e CORE_PEER_ADDRESS=peer0.org2.example.com:9051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin#org2.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt cli peer --tls=true --cafile=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --orderer=orderer.example.com:7050 lifecycle chaincode install fabcar.tar.gz
I assume I aam using the latest version of hyperledger-fabric v2.0.0, since I am in the master branch of the fabric-samples repository. What am I doing wrong?
I had/have the same issue. What worked in my case was what I have described in my own question here - Hyperledger Fabric 2.0 byfn.sh error installing chaincode
Basically, even though there is an error (for some reason I do not know), the chaincode installation process is alive in the background and the chaincode does get installed.
I saw this behavior and put in a sleep statement for 10 minutes (600 s). I still do not know why this behavior is there (hence my question) but I have a workaround for now.
You need to open ports in the firewall.
in ubuntu I fix it using :
$ sudo ufw allow 4422/tcp
repeat for each docker container port,
You can view ports via :
$ docker ps
Have you stopped the first-network at first by using ./byfn.sh down before you jump into fabcar ?
Can I see some logs like docker ps -a and docker logs peer0.org1.example.com?
Also the HLF has recommended to use test-network as a replacement for first-network which is deprecated by now.
BTW, I would use the release branch other than master. Afterall the master branch is always under developing.

Peer node is not starting in commercial paper samples

I am trying to run the ./start.sh as specified in the tutorial https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html
I am getting the error:
Error response from daemon: Container 3098af67969c5388c78f3ed97b9941ac637c7292342cd90e109a6c5e3ef2a5ea is not running
Basically Peer node container is not getting up. Can you please help me?
This Ubuntu VM is hosted in Cloud
Please check the peer node container Logs:
root#UbuntuVM:/home/NagaRajeshK/hyperledgerdev/fabric-samples/basic-network# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e60a0578eae4 hyperledger/fabric-orderer "orderer" 3 minutes ago Up 2 minutes 0.0.0.0:7050->7050/tcp orderer.example.com
c1c5510432f5 hyperledger/fabric-ca "sh -c 'fabric-ca-se…" 3 minutes ago Up 2 minutes 0.0.0.0:7054->7054/tcp ca.example.com
9cf315b8946c hyperledger/fabric-couchdb "tini -- /docker-ent…" 3 minutes ago Up 2 minutes 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb
root#UbuntuVM:/home/NagaRajeshK/hyperledgerdev/fabric-samples/basic-network# docker logs 3098af67969c
2019-04-05 13:51:59.154 UTC [nodeCmd] serve -> INFO 001 Starting peer:
Version: 1.4.1-rc1
Commit SHA: 29433f0
Go version: go1.11.5
OS/Arch: linux/amd64
Chaincode:
Base Image Version: 0.4.15
Base Docker Namespace: hyperledger
Base Docker Label: org.hyperledger.fabric
Docker Namespace: hyperledger
2019-04-05 13:51:59.155 UTC [ledgermgmt] initialize -> INFO 002 Initializing ledger mgmt
2019-04-05 13:51:59.155 UTC [kvledger] NewProvider -> INFO 003 Initializing ledger provider
2019-04-05 13:51:59.495 UTC [kvledger] NewProvider -> INFO 004 ledger provider Initialized
2019-04-05 13:51:59.791 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 005 Created state database _users
2019-04-05 13:51:59.890 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 006 Created state database _replicator
2019-04-05 13:51:59.891 UTC [ledgermgmt] initialize -> INFO 007 ledger mgmt initialized
2019-04-05 13:51:59.891 UTC [peer] func1 -> INFO 008 Auto-detected peer address: 172.18.0.5:7051
2019-04-05 13:51:59.891 UTC [peer] func1 -> INFO 009 Returning peer0.org1.example.com:7051
2019-04-05 13:51:59.891 UTC [peer] func1 -> INFO 00a Auto-detected peer address: 172.18.0.5:7051
2019-04-05 13:51:59.891 UTC [peer] func1 -> INFO 00b Returning peer0.org1.example.com:7051
2019-04-05 13:51:59.893 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00c Entering computeChaincodeEndpoint with peerHostname: peer0.org1.example.com
2019-04-05 13:51:59.893 UTC [nodeCmd] computeChaincodeEndpoint -> INFO 00d Exit with ccEndpoint: peer0.org1.example.com:7052
2019-04-05 13:51:59.894 UTC [nodeCmd] createChaincodeServer -> WARN 00e peer.chaincodeListenAddress is not set, using peer0.org1.example.com:7052
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x63 pc=0x7f803c547259]
runtime stack:
Can you update your fabric-samples, git pull from root of fabric-samples, and run the start.sh script again. You have the rc-1 script, which should work, but 1.4.1 officially released yesterday, can you see if the new tutorial works.

Instantiation of chaincode fails with Fabric v1.2.0 due to missing escc

Setup is working fine with Fabric 1.1.0
When I tried to upgrade to Fabric 1.2.0, I got the following errors during instantiation of chaincode saying that „escc was not found“
[golang-platform] GenerateDockerBuild -> INFO 072 building chaincode with ldflagsOpt: '-ldflags "-linkmode external -extldflags '-static'"'
2018-08-09 20:00:31.815 UTC [golang-platform] GenerateDockerBuild -> INFO 073 building chaincode with tags:
2018-08-09 20:01:01.188 UTC [endorser] EndorseWithPlugin -> WARN 074 Endorsement with plugin for {plugin: escc, channel: channel3, tx: 01427f701088a8e8cdfe2b543892af33d4012a661474f88670c8e2739717062f, chaincode: lscc} failed: plugin with name escc wasn't found
My Fabric peer setup is not based on docker images, but I did install fabric myself using with git clone and build (git reset --hard v1.2.0; make peer...). It is a fresh installed Ubuntu Linux 16.04.
Didn't change any setup.
Any ideas?
You need to make sure your core.yaml file is also updated to v1.2

Failed to generate orderer genesis block

I'm trying to build a network with hyperledger fabric, but each time it shows me an error.
Also I'm using docker images 1.0.3.
npm version: 5.6.0
nodejs version: v4.2.6
Client:
Version: 18.05.0-ce
API version: 1.37
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:16:25 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.05.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: f150324
Built: Wed May 9 22:14:32 2018
OS/Arch: linux/amd64
Experimental: false
docker-compose version 1.16.0-rc1, build 9bea70a
docker-py version: 2.5.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
Generating certs and genesis block for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
/home/bashayer/fabric-samples/first-network/../bin/cryptogen
##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x
/home/bashayer/fabric-samples/first-network/../bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
2018-07-06 16:29:48.898 +03 [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-07-06 16:29:48.898 +03 [common/tools/configtxgen] main -> INFO 002 Loading configuration
2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewChannelGroup -> WARN 003 Default policy emission is deprecated, please include policy specificiations for the channel group in configtx.yaml
2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewOrdererGroup -> WARN 004 Default policy emission is deprecated, please include policy specificiations for the orderer group in configtx.yaml
2018-07-06 16:29:48.906 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 005 Default policy emission is deprecated, please include policy specificiations for the orderer org group OrdererOrg in configtx.yaml
2018-07-06 16:29:48.907 +03 [msp] getMspConfig -> INFO 006 Loading NodeOUs
2018-07-06 16:29:48.907 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 007 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org1MSP in configtx.yaml
2018-07-06 16:29:48.907 +03 [msp] getMspConfig -> INFO 008 Loading NodeOUs
2018-07-06 16:29:48.907 +03 [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 009 Default policy emission is deprecated, please include policy specificiations for the orderer org group Org2MSP in configtx.yaml
2018-07-06 16:29:48.907 +03 [common/tools/configtxgen] doOutputBlock -> INFO 00a Generating genesis block
2018-07-06 16:29:48.908 +03 [common/tools/configtxgen] doOutputBlock -> INFO 00b Writing genesis block
2018-07-06 16:29:48.908 +03 [common/tools/configtxgen] main -> CRIT 00c Error on outputBlock: Error writing genesis block: open ./channel-artifacts/genesis.block: is a directory
+ res=1
+ set +x
Failed to generate orderer genesis block...
in my case (windows 10) generated the genesis block in missing folder:
$./byfn.sh down
$../bin/cryptogen generate --config=./crypto-config.yaml
Org1.example.com
Org2.example.com
$../bin/configtxgen --profile TwoOrgsOrdererGenesis –outputBlock./channel-
artifacts/genesis.block
$./byfn.sh generate
$./byfn.sh up
The issue occured because the system could not find any genesys.block in your channel-artifacts.
Make sure you have generated the genesys.block file at the specified location.
I hope it helps.
In our case it was the missing folder: ./channel-artifacts/
the .block file is auto created anyways
i was having a similar error
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --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: 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"
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
ERROR !!!! Test failed
solved it by just running ./byfn.sh up in fabric-samples/first-network/
Use this branch repo release-1.4:
https://github.com/hyperledger/fabric-samples/tree/release-1.4
$ git clone --branch release-1.4 https://github.com/hyperledger/fabric-samples.git
Anyhow first-network tutorial is deprecated
and try this video from 10:00 onwards: https://www.youtube.com/watch?v=kRwPCPdj86s

Resources