{"record":{"id":"5b3af031a75a5e5d","repo":"hyperledger/fabric","slug":"cannot-read-channels-list-response-s","errorCode":null,"errorMessage":"Cannot read channels list response, %s","messagePattern":"Cannot read channels list response, (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/channel/list.go","lineNumber":79,"sourceCode":"\tvar signedProp *pb.SignedProposal\n\tsignedProp, err = protoutil.GetSignedProposal(prop, cc.cf.Signer)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Cannot create signed proposal, due to %s\", err)\n\t}\n\n\tproposalResp, err := cc.cf.EndorserClient.ProcessProposal(context.Background(), signedProp)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed sending proposal, got %s\", err)\n\t}\n\n\tif proposalResp.Response == nil || proposalResp.Response.Status != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"Received bad response, status %d: %s\", proposalResp.Response.Status, proposalResp.Response.Message)\n\t}\n\n\tvar channelQueryResponse pb.ChannelQueryResponse\n\terr = proto.Unmarshal(proposalResp.Response.Payload, &channelQueryResponse)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Cannot read channels list response, %s\", err)\n\t}\n\n\treturn channelQueryResponse.Channels, nil\n}\n\nfunc list(cf *ChannelCmdFactory) error {\n\tvar err error\n\tif cf == nil {\n\t\tcf, err = InitCmdFactory(EndorserRequired, PeerDeliverNotRequired, OrdererNotRequired)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tclient := &endorserClient{cf}\n\n\tif channels, err := client.getChannels(); err != nil {\n\t\treturn err","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/channel/list.go#L61-L97","documentation":"This error is returned by getChannels when the payload of an approved proposal response cannot be unmarshaled into a pb.ChannelQueryResponse protobuf message. It means the orderer/peer returned a successful status, but the response bytes are not a valid encoded channels-list structure. This typically indicates the endpoint is not the service expected or a protobuf/runtime incompatibility.","triggerScenarios":"Calling the peer channel list command when the proposal response payload contains malformed, empty, or non-ChannelQueryResponse protobuf bytes — e.g. the targeted node is not actually serving the channels query service, or the fabric-protos library version differs from the server's.","commonSituations":"Pointing the CLI at an orderer or wrong peer port instead of the peer's channel query endpoint; running a newer/older fabric CLI against an older network (protobuf schema drift); a proxy returning an HTML/JSON error body inside a 200 response.","solutions":["Verify the peer address/port in --peerAddress (or CORE_PEER_ADDRESS) points to a real fabric peer, not an orderer or another service","Align the fabric-protos-go / fabric-cli versions with the network's Fabric release","Enable debug logging and inspect the raw proposal response payload to confirm what the server actually returned","Retry against a different peer in the organization to rule out a misbehaving single node"],"exampleFix":"// before\npeerClient, err := channel.NewDeliverClient(...) // wrong target: orderer endpoint\nchans, err := getChannels(cf) // Cannot read channels list response\n// after\n// set correct peer endpoint\nos.Setenv(\"CORE_PEER_ADDRESS\", \"peer0.org1.example.com:7051\")\nchans, err := getChannels(cf)","handlingStrategy":"validation","validationCode":"// Before calling list, verify the peer endpoint responds to the query service\nresp, err := proposalResp(ctx, peer)\nif err != nil { return err }\nif len(resp.Response.Payload) == 0 {\n    return fmt.Errorf(\"empty payload from peer %s; not a channels query endpoint\", peerURL)\n}\nvar cqr pb.ChannelQueryResponse\nif err := proto.Unmarshal(resp.Response.Payload, &cqr); err != nil {\n    return fmt.Errorf(\"peer %s returned non-protobuf payload; check endpoint/versions\", peerURL)\n}","typeGuard":"func isValidChannelQueryResponse(payload []byte) bool {\n    var cqr pb.ChannelQueryResponse\n    return proto.Unmarshal(payload, &cqr) == nil\n}","tryCatchPattern":null,"preventionTips":["Pin fabric-protos-go and fabric versions to the same release line as the network","Sanity-check CORE_PEER_ADDRESS points at a peer (7051), not an orderer (7050)","Log the response status and payload length before unmarshaling"],"tags":["grpc","protobuf","hyperledger-fabric","deserialization"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}