hyperledger-labs / minifabric

Do fabric network the right and easy way.
Apache License 2.0
302 stars 164 forks source link

minifab command fails with latest version of Fabric: 2.4.3 #330

Open jsolderitsch opened 2 years ago

jsolderitsch commented 2 years ago

I used the command:

./minifab up -i 2.4.3

The startup sequence failed pretty early on:

Using default spec file
Minifab Execution Context:
    FABRIC_RELEASE=2.4.3
    CHANNEL_NAME=mychannel
    PEER_DATABASE_TYPE=golevel
    CHAINCODE_LANGUAGE=go
    CHAINCODE_NAME=simple
    CHAINCODE_VERSION=1.0
    CHAINCODE_INIT_REQUIRED=true
    CHAINCODE_PARAMETERS="init","a","200","b","300"
    CHAINCODE_PRIVATE=false
    CHAINCODE_POLICY=
    TRANSIENT_DATA=
    BLOCK_NUMBER=newest
    EXPOSE_ENDPOINTS=false
    CURRENT_ORG=org0.example.com
    HOST_ADDRESSES=192.168.1.199,192.168.1.218
    WORKING_DIRECTORY: /Users/jjs/mywork
.......
# Preparing for the following operations: *********************
  verify options, download images, generate certificates, start network, network status, channel create, channel join, anchor update, profile generation, cc install, cc approve, cc commit, cc initialize, discover
.......
# Running operation: ******************************************
  verify options
.
# Running operation: ******************************************
  download images
............
# Running operation: ******************************************
  generate certificates
..
# Running operation: ******************************************
  start network
....................
# Running operation: ******************************************
  network status
...
# Current Minifabric image ID and created at date time ********
  bca4eee8a45f   2022-02-17 21:29:10 +0000 UTC
.....
# Docker node status ******************************************
  mysite : Up 9 seconds
  ca1.org1.example.com : Up 11 seconds
  ca1.org0.example.com : Up 13 seconds
  orderer3.example.com : Up 15 seconds
  orderer2.example.com : Up 17 seconds
  orderer1.example.com : Up 19 seconds
  peer2.org1.example.com : Up 21 seconds
  peer1.org1.example.com : Up 23 seconds
  peer2.org0.example.com : Up 24 seconds
  peer1.org0.example.com : Up 24 seconds

# Fabric network peer and orderer node health status **********
  peer1.org0.example.com "OK"
  peer2.org0.example.com "OK"
  peer1.org1.example.com "OK"
  peer2.org1.example.com "OK"
  orderer1.example.com "OK"
  orderer2.example.com "OK"
  orderer3.example.com "OK"
  Network Status: 100%

# Running operation: ******************************************
  channel create
.....
# Run the channel creation script on cli container ************
  non-zero return code
  2022-03-09 00:05:12.222 UTC 0001 INFO [common.tools.configtxgen] main -> Loading configuration
  2022-03-09 00:05:12.267 UTC 0002 INFO [common.tools.configtxgen.localconfig] Load -> Loaded configuration: /vars/configtx.yaml
  2022-03-09 00:05:12.267 UTC 0003 INFO [common.tools.configtxgen] doOutputChannelCreateTx -> Generating new channel configtx
  2022-03-09 00:05:12.565 UTC 0004 INFO [common.tools.configtxgen] doOutputChannelCreateTx -> Writing new channel tx
  2022-03-09 00:05:12.764 UTC 0001 INFO [channelCmd] InitCmdFactory -> Endorser and orderer connections initialized
  Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group]  /Channel/Application be at version 0, but it is currently at version 1

# STATS *******************************************************
minifab: ok=89  failed=1    

The version of the Fabric that used by default is 2.3.0 and this starts up cleanly.

Any ideas or a work-around -- e.g. how to change Channel/Application version that is used?

jsolderitsch commented 2 years ago

Well it seems that I needed to do a cleanup option with minifab BEFORE I ran the up option with the i 2.4.3 version specified. Doing the down option was NOT enough. If someone can confirm this as a basic user error, I will close the issue.

litong01 commented 2 years ago

@jsolderitsch jim, down is basically kills the containers (nodes), it will not remove any data such as ledger, so when you try to bring things up again, it should fail using different version. This is actually the expected behavior, cleanup removes everything. I think you can close this issue.

jsolderitsch commented 2 years ago

Thanks Tong for the quick reply. I will close the issue as user error.

jsolderitsch commented 2 years ago

Well I am re-opening this issue because while I can use minifab up -i 2.4.3 to startup Minifabric successfully, I can't use it again after I run minifab down. But once again, maybe doing an up, and then a down, and then an up again is not normal user behavior. Should minifab restartbe used instead?

jpsauve commented 2 years ago

Also, this command fails in the CC install step: ./minifab up -i 2.4.3 -l node -e true

Here is the output: non-zero return code Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Error returned from build: 1 "+ INPUT_DIR=/chaincode/input

STATS ***

minifab: ok=29 failed=1