hyperledger/fabric · error

cannot read qscc response

Error message

cannot read qscc response

What it means

Returned by getBlockChainInfo when the payload of a successful (HTTP 200) qscc proposal response cannot be unmarshaled into a cb.BlockchainInfo protobuf. This indicates the peer returned 200 but the payload is not the expected serialized BlockchainInfo, so the CLI cannot decode the channel metadata.

Source

Thrown at internal/peer/channel/getinfo.go:78

	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 = true

	var err error
	if cf == nil {
		cf, err = InitCmdFactory(EndorserRequired, PeerDeliverNotRequired, OrdererNotRequired)
		if err != nil {
			return err

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Check that the peer binary and fabric-cli/peer binary are the same Fabric version.
  2. Bypass proxies/middlewares and query the peer directly to rule out payload corruption.
  3. Inspect the raw response payload and peer logs for the actual message type returned.
  4. Upgrade the peer or client so both speak the same protobuf schema.
Defensive patterns

Strategy: retry

Validate before calling

peer version  # compare with peer binary version in the network
fabric-peer-container: peer version must match CLI major/minor

Try / catch

// Retry once directly against the peer (no proxy); if it persists, treat as version/schema mismatch
if ! peer channel getinfo -c "$CHAN"; then
  peer channel getinfo -c "$CHAN" --tls --cafile "$CA"  # direct peer endpoint
fi

Prevention

When it happens

Trigger: Calling `peer channel getinfo` against a peer that returns a malformed or non-standard qscc payload — typically a Fabric version mismatch between client binary and peer, a proxy/gateway intercepting the response, or a corrupted payload.

Common situations: Mixed Fabric v1.x/v2.x versions in the network; a custom qscc or chaincode replacement returning a different message type; an intermediary (envoy/proxy) rewriting response bodies.

Understand the failure class

Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/707b5d3cf6060483. Report an issue: GitHub.