hyperledger/fabric · error
received bad response, status %d: %s
Error message
received bad response, status %d: %s
What it means
This error is returned by getBlockChainInfo in the peer channel getinfo command when the qscc (Query System Chaincode) proposal sent to the endorser comes back with a non-200 response status (or with no Response at all). The endorser processed the proposal but rejected or failed it, so the message embeds the peer-provided status code and message. It means the channel query itself failed at the peer, not the network transport.
Source
Thrown at internal/peer/channel/getinfo.go:72
c, _ := cc.cf.Signer.Serialize()
prop, _, err = protoutil.CreateProposalFromCIS(cb.HeaderType_ENDORSER_TRANSACTION, "", invocation, c)
if err != nil {
return nil, errors.WithMessage(err, "cannot create proposal")
}
var signedProp *pb.SignedProposal
signedProp, err = protoutil.GetSignedProposal(prop, cc.cf.Signer)
if err != nil {
return nil, errors.WithMessage(err, "cannot create signed proposal")
}
proposalResp, err := cc.cf.EndorserClient.ProcessProposal(context.Background(), signedProp)
if err != nil {
return nil, errors.WithMessage(err, "failed sending proposal")
}
if proposalResp.Response == nil || proposalResp.Response.Status != http.StatusOK {
return nil, errors.Errorf("received bad response, status %d: %s", proposalResp.Response.Status, proposalResp.Response.Message)
}
blockChainInfo := &cb.BlockchainInfo{}
err = proto.Unmarshal(proposalResp.Response.Payload, blockChainInfo)
if err != nil {
return nil, errors.Wrap(err, "cannot read qscc response")
}
return blockChainInfo, nil
}
func getinfo(cmd *cobra.Command, cf *ChannelCmdFactory) error {
// the global chainID filled by the "-c" command
if channelID == common.UndefinedParamValue {
return errors.New("Must supply channel ID")
}
// Parsing of the command line is done so silence cmd usage
cmd.SilenceUsage = trueView on GitHub (pinned to 2736b63f8f)
Solutions
- Verify the channel ID with -c and confirm the peer has joined it (`peer channel list`).
- Check the peer logs around the request for the underlying qscc error (status 500 usually carries a detail message).
- Confirm your signing identity's MSP is a member of the channel and the certificate has not expired.
- Retry after fixing peer/ledger issues reported in the peer logs.
Example fix
// before peer channel getinfo # no -c, hits default channel // after peer channel getinfo -c mychannel
Defensive patterns
Strategy: validation
Validate before calling
// Verify the peer has joined the channel before getinfo // peer channel list → confirm "mychannel" appears // Also check identity: peer channel getinfo -c mychannel with correct CORE_PEER_MSPCONFIGPATH
Try / catch
// shell if ! out=$(peer channel getinfo -c "$CHAN" 2>&1); then echo "getinfo failed: $out" # inspect status/message from endorser fi
Prevention
- Always pass -c with a channel the peer has joined (verify with peer channel list).
- Keep client and peer Fabric versions aligned.
- Ensure the invoking identity's MSP belongs to the channel consortium.
- Read peer logs for the qscc error behind non-200 statuses.
When it happens
Trigger: Running `peer channel getinfo` when the peer rejects the proposal: the channel does not exist on the peer, the client identity is not authorized on the channel, or the qscc GetChainInfo invocation returned an application-level error status (e.g. 500 from chaincode execution).
Common situations: Querying a channel the peer has not joined; using an MSP/identity not enrolled in the target channel; a peer that cannot access the ledger for that channel; org membership misconfiguration after network changes.
Related errors
- error encode input
- reading config block: %s
- reading config updte envelope: %s
- '%s' not equal <newest|oldest|config|(number)>
- chaincode invocation spec did not contain chaincode spec
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/b168610db8885b91.
Report an issue: GitHub.