Skip to content
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

Error when creating an new channel, "Got unexpected status: BAD_REQUEST" #51

Closed
tpasquet opened this issue May 31, 2017 · 46 comments
Closed
Labels

Comments

@tpasquet
Copy link

I'm getting one issue trying to create a new channel.
I run this command :
peer channel create -o orderer.example.com:7050 -c ${CHANNEL_NAME} -f ./peer/channel-artifacts/channel.tx
But i got this error "Error: Got unexpected status: BAD_REQUEST"
Do you know where did this come from ?
Thanks a lot !

@tpasquet
Copy link
Author

From the orderer.example.com logs, i got :
" Rejecting CONFIG_UPDATE because: Error authorizing update: Error validating ReadSet: Readset expected key [Groups] /Channel/Application at version 0, but got version 1"

@yeasy
Copy link
Owner

yeasy commented Jun 3, 2017

Seems the channel is already created?

@yeasy yeasy added the question label Jun 3, 2017
@bizhenchao1201
Copy link

i met the same error.

@yeasy
Copy link
Owner

yeasy commented Jun 13, 2017

@bizhenchao1201 can u try with the latest steps?

what os/version are u using?

@rsindper
Copy link

@yeasy Hello, I got an error saying "Error: Invalid channel create transaction : mismatched channel ID businesschannel != mychannel" when I tried to create "mychannel". Is this because I have already create a businesschannel? If so, how can I deleter bussinesschannel and create mychannel? Thank you in advance.

@qiang0723
Copy link
Contributor

@RunshanHu yeah, because the configs in e2e/channel-artifacts has been re-generated with businesschannel, refer to this
second, channel can not be deleted, see peer channel --help, has no remove or delete

@qiang0723
Copy link
Contributor

Don't forget to set *TLS_ENABLED to false in peer_base.yaml and orderer_base.yaml, cause some example under no-tls, distinguish them is to see whether there is --cafile $ORDERER_CA in command, hope can help you.

@bizhenchao1201
Copy link

@yeasy you are right , channel is already created

@yeasy yeasy closed this as completed Jun 15, 2017
@akshay2218
Copy link

I am also getting the same error, any update.

@himanshutyagi36
Copy link

@akshay2218 Start with a fresh config and new channel name. Also, try passing the -t int flag in peer channel create command. Might be an issue that the command is timing before generating the channel genesis block.

@ViswanathLekshmanan
Copy link

Any idea ?

Error: Got unexpected status: BAD_REQUEST
Usage:
peer channel create [flags]

@VemiReddyN
Copy link

I'm getting one issue trying to create a new channel.
I run this command:
#node main.js

create mychannel......
error: [Orderer.js]: sendBroadcast - on error: "Error: Connect Failed\n at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:255:19)\n at ClientDuplexStream._readsDone (/opt/caliper/node_modules/grpc/src/client.js:221:8)\n at readCallback (/opt/caliper/node_modules/grpc/src/client.js:283:12)"
not ok 1 Failed to create channels Error: SERVICE_UNAVAILABLE at ClientDuplexStream. (/opt/caliper/node_modules/fabric-client/lib/Orderer.js:128:21) at emitOne (events.js:96:13) at ClientDuplexStream.emit (events.js:188:7) at ClientDuplexStream._emitStatusIfDone (/opt/caliper/node_modules/grpc/src/client.js:258:12) at ClientDuplexStream._readsDone (/opt/caliper/node_modules/grpc/src/client.js:221:8) at readCallback (/opt/caliper/node_modules/grpc/src/client.js:283:12)

@yeasy
Copy link
Owner

yeasy commented Dec 20, 2017

@VemiReddyN guess u're using the node sdk, pls ask in chat.hyperledger.org/channel/fabric-sdk-node.
Thanks!

@jbuusao
Copy link

jbuusao commented Jan 9, 2018

I had the same error because the channel was already started. If this is the case then try
./byfn.sh -m restart -c channelName

@jainandy
Copy link

jainandy commented Feb 8, 2018

The error is due to the presence of a channel already with the name "mychannel".
When starting up the network we used the command:
CHANNEL_NAME=$CHANNEL_NAME TIMEOUT=10000 docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d

If you check the docker-compose-cli.yaml file, for the CLI container the below command is present, which executes the script.
command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME} ${DELAY}; sleep $TIMEOUT'

Now this script creates the channel, installs the chaincode as well as instantiates the chaincode.
So if we run this script, we can directly query the database.

Hope this helps... :) :)

@darapich16
Copy link

darapich16 commented Mar 1, 2018

@jainandy I follow your solution but i still get error. first i use CHANNEL_NAME=$CHANNEL_NAME TIMEOUT=10000 docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d and continue Query from [http://hyperledger-fabric.readthedocs.io/en/master/build_network.html]. it showed error Error: Error endorsing query: rpc error: code = Unknown desc = Failed to deserialize creator identity, err MSP Org1MSP is unknown - <nil>.

@jainandy
Copy link

jainandy commented Mar 3, 2018

@darapich16 ,The error says it cannot find the Org1MSP. I hope you have ran the configtxgen. Also you check if the permissions are granted properly.

@dmitrysenkovich
Copy link

in my case I forgot to specify those 4 environment variables from the docs page:

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/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.crt

@xy250400
Copy link

@tpasquet hey guy,have you fixed it now?I have the same error.

@corpsemxq
Copy link

2018-03-26 18:22:44.116 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application at version 0, but got version 1
Usage:
peer channel create [flags]

@Tang-xun
Copy link

Tang-xun commented Apr 8, 2018

./byfn.sh -m restart -c channelName
is right , 3Q for @fjbuusao

@nitishbhushan2013
Copy link

I am also getting a same kind of exception. If any one else has got the same and resolved it, req to pls share the resolution

2018-08-10 14:15:22.634 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- Consortium config value missing

@xuguangyuansh
Copy link

you are right, channel of mychannel is already exists, peer channel list will join the channel again .

@bairathirahul
Copy link

@corpsemxq

that error is due to your identity certificate. Check the orderer log, it will show you more info. In my case, it has indicated that I have specified wrong MSP's certificate.

@vishwajitmankar
Copy link

[channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application at version 0, but got version 1
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

I first brought it down and then up again and it worked for me -
./byfn.sh down
./byfn.sh up

@jiaxyan
Copy link

jiaxyan commented Oct 6, 2018

...Rejecting broadcast of config message from 172.19.0.1:40846 because of error: error authorizing update: error validating DeltaSet: attempted to set key [Value] /Channel/Application/Org1MSP/AnchorPeers to version 1, but key does not exist
got the same error

@AdelinGhanaem
Copy link

If you've run the script properly at the beginning then everything was created and you are getting these error because of:

These steps describe the scenario in which script.sh is run by ‘./byfn.sh up’. Clean your network with ./byfn.sh down and ensure this command is active. Then use the same docker-compose prompt to launch your network again

@richhamseth
Copy link

richhamseth commented Dec 6, 2018

@tpasquet hey guy,have you fixed it now?I have the same error.

@yeasy @tpasquet even i have same issue
iam trying to update using

peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.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

2018-12-06 10:03:08.299 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application/Org2MSP at version 0, but got version 1

@salmanfarisk
Copy link

I successfully created the channel. But do not joining peer0 to the same channel . I just disable the TLS properties of orderer and peer, It working well. I set all environmental variables. But I get error every time.
Command: peer channel join -b mychannel.block

Error: 2018-12-07 12:04:55.565 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-12-07 12:04:55.565 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-12-07 12:04:55.566 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-12-07 12:04:55.566 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0AA9070A5C08011A0C08E7C3A9E00510...DC57D85DCE3F1A080A000A000A000A00
2018-12-07 12:04:55.566 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: C19B85B8498CD4E3607BC5D687412C9641B920A55BCB7746A80897C8AFBBD7C7
2018-12-07 12:04:55.567 UTC [grpc] Printf -> DEBU 006 transport: http2Client.notifyError got notified that the client transport was broken read tcp 192.168.240.17:40432->192.168.240.16:7051: read: connection reset by peer.
Error: proposal failed (err: rpc error: code = Unavailable desc = transport is closing)
2018-12-07 12:04:55.567 UTC [grpc] Printf -> DEBU 007 transport: http2Client.notifyError got notified that the client transport was broken read tcp 192.168.240.17:40434->192.168.240.16:7051: read: connection reset by peer.
2018-12-07 12:04:55.568 UTC [grpc] Printf -> DEBU 008 transport: http2Client.notifyError got notified that the client transport was broken read tcp 192.168.240.17:40436->192.168.240.16:7051: read: connection reset by peer.

NB: I use kafka based ordering service

Fabric: 1.1.0

Composer:0.19.16

node:8.11.3

Please give a suggestions, Thanks in advance.

@nguoibanso25
Copy link

I am also getting a same kind of exception. If any one else has got the same and resolved it, req to pls share the resolution

2018-08-10 14:15:22.634 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- Consortium config value missing

I have same error. Did you fix?

@chenweiw09
Copy link

i restart the network with "bash byfn.sh -m restart -c mychannel", but it still can not work. The error is "because of error: error authorizing update: error validating ReadSet: readset expected key [Group] /Channel/Application/Org1MSP at version 0, but got version 1".

@blockchainguyy
Copy link

Hi guys, I'm experiencing a similar issue: i have detailed it here: https://stackoverflow.com/questions/57144745/cannot-create-channels-with-new-orgs-in-fabric-got-error-attempted-to-include

Can you please help me?

@nguoibanso25
Copy link

nguoibanso25 commented Jul 22, 2019 via email

@nguoibanso25
Copy link

nguoibanso25 commented Jul 22, 2019 via email

@blockchainguyy
Copy link

@nguoibanso25 thanks for replying, but i don't want to restart my network, just tweak the consortium of an already running network.

@nguoibanso25
Copy link

nguoibanso25 commented Jul 23, 2019 via email

@mdxooa
Copy link

mdxooa commented Jul 23, 2019

Hi @ayush-deqode you can follow below steps to add new organisation to consortium

$: peer channel fetch config config_block.pb -o orderer.example.com:7050
    -c testchainid

   $: configtxlator proto_decode --input config_block.pb --type common.Block | jq .data.data[0].payload.data.config > config.json

   $: jq -s '.[0] * {"channel_group":{"groups":{"Consortiums":{"groups": {"TestConsortium": {"groups": {"Org3MSP":.[1]}}}}}}}' config.json ./org3.json > modified_config.json

   $: configtxlator proto_encode --input config.json --type common.Config
    --output config.pb

   $: configtxlator proto_encode --input modified_config.json --type common.Config --output modified_config.pb

  $:  configtxlator compute_update --channel_id testchainid --original config.pb --updated modified_config.pb --output org_update.pb

   $: configtxlator proto_decode --input  org_update.pb --type common.ConfigUpdate | jq . > org_update.json

  $:  echo '{"payload":{"header":{"channel_header":{"channel_id":"testchainid", "type":2}},"data":{"config_update":'$(cat org_update.json)'}}}' | jq . > org_update_in_envelope.json

   $: configtxlator proto_encode --input org_update_in_envelope.json --type common.Envelope --output org_update_in_envelope.pb

   $: peer channel signconfigtx -f org_update_in_envelope.pb

   $: peer channel update -f org_update_in_envelope.pb -c testchainid -o orderer.example.com:7050

@blockchainguyy
Copy link

@mdxooa it works, thank you so much!

@arslanalics16
Copy link

Don't forget to set *TLS_ENABLED to false in peer_base.yaml and orderer_base.yaml, cause some example under no-tls, distinguish them is to see whether there is --cafile $ORDERER_CA in command, hope can help you.

qiang i have a confusion .
can you explain that why we do TLS disabled .and if do not disable then what consequence will happen .and if modify to false then what sort of benefits will be i get.

@Chreokee
Copy link

I had the same error because the channel was already started. If this is the case then try
./byfn.sh -m restart -c channelName

Thank you!I have solved this problem by your method

@2212243743
Copy link

i tried set up hyperledger fabric with multiple hosts and i stoped containers and remove it after i tested my fabric. i met this question when i restart my fabric(i tried create a new channel and channel name is same as the last time), jbuusao works,and i read the byfn.sh in vim,and i found when you exec "byfn.sh down" the sh would remove some volumes in docker,so i tried exec "docker volume prune" and found the channel and chaincode was delete,you may test in your situation,it may work.
(ps. hope you can understand my suggestion,cause my english is poor)

@softronsts
Copy link

i tried set up hyperledger fabric with multiple hosts and i stoped containers and remove it after i tested my fabric. i met this question when i restart my fabric(i tried create a new channel and channel name is same as the last time), jbuusao works,and i read the byfn.sh in vim,and i found when you exec "byfn.sh down" the sh would remove some volumes in docker,so i tried exec "docker volume prune" and found the channel and chaincode was delete,you may test in your situation,it may work. (ps. hope you can understand my suggestion,cause my english is poor)

tq. this worked.

@bellaj
Copy link

bellaj commented Dec 6, 2021

The channel already exists

@LilyID
Copy link

LilyID commented Dec 21, 2021

I have this error when I wanted to enter the CLI with sudo docker exec -it cli bash in chaincode-docker-devmode. Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'myc': 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.
How can I fix this problem? Do these solutions work?:

./byfn.sh down
./byfn.sh up

./byfn.sh -m restart -c channelName

If Yes, from which directory to enter these commands? I started the dev-network with sudo docker-compose -f docker-compose-simple.yaml up.

Do you know how to stop the Hyperledger Fabric tools / cli from exiting? I always have this problem.

@kangkang333
Copy link

In my case, I shut down docker directly, not clearing the Fabric network firstly. After clearing the old Fabric network, the command works

@oguzhannkayaa
Copy link

channel should be already exists. first need to create channel and genesis block, in create-artifacts. After that you specify the channel location which you created in first place in create-channel artifacts. but after that creating channel with giving orderer IP and channel location gives the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests