hyperledger/fabric · error

unmarshalling ChaincodeQueryResponse failed, error %s

Error message

unmarshalling ChaincodeQueryResponse failed, error %s

What it means

Returned by getInstantiatedCC when the stored bytes for an instantiated chaincode cannot be proto-unmarshaled into ChaincodeData. Ledger state for the chaincode exists but is corrupt, so its existence cannot be confirmed.

Source

Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:629

		err = fmt.Errorf("could not retrieve QueryExecutor for channel %s, error %s", chid, err)
		return
	}
	defer qe.Done()
	channelState := &state{qe}
	bytes, err := channelState.GetState("lscc", ccid)
	if err != nil {
		err = fmt.Errorf("could not retrieve state for chaincode %s on channel %s, error %s", ccid, chid, err)
		return
	}

	if bytes == nil {
		return
	}

	cd = &ccprovider.ChaincodeData{}
	err = proto.Unmarshal(bytes, cd)
	if err != nil {
		err = fmt.Errorf("unmarshalling ChaincodeQueryResponse failed, error %s", err)
		return
	}

	exists = true
	return
}

type state struct {
	vs.State
}

// GetState retrieves the value for the given key in the given namespace
func (s *state) GetState(namespace string, key string) ([]byte, error) {
	values, err := s.GetStateMultipleKeys(namespace, []string{key})
	if err != nil {
		return nil, err
	}
	if len(values) == 0 {

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Investigate how invalid bytes were committed under the lscc namespace
  2. Rebuild or repair the channel ledger if corruption is confirmed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at core/handlers/validation/builtin/v13/lscc_validation_logic.go:629 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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