{"record":{"id":"e7f9f9f3e9e0b42b","repo":"hyperledger/fabric","slug":"query-failed-with-status-d-s","errorCode":null,"errorMessage":"query failed with status: %d - %s","messagePattern":"query failed with status: (.+?) - (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/lifecycle/chaincode/checkcommitreadiness.go","lineNumber":186,"sourceCode":"\t\treturn errors.WithMessage(err, \"failed to create signed proposal\")\n\t}\n\n\t// checkcommitreadiness currently only supports a single peer\n\tproposalResponse, err := c.EndorserClient.ProcessProposal(context.Background(), signedProposal)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"failed to endorse proposal\")\n\t}\n\n\tif proposalResponse == nil {\n\t\treturn errors.New(\"received nil proposal response\")\n\t}\n\n\tif proposalResponse.Response == nil {\n\t\treturn errors.New(\"received proposal response with nil response\")\n\t}\n\n\tif proposalResponse.Response.Status != int32(cb.Status_SUCCESS) {\n\t\treturn errors.Errorf(\"query failed with status: %d - %s\", proposalResponse.Response.Status, proposalResponse.Response.Message)\n\t}\n\n\tif strings.ToLower(c.Input.OutputFormat) == \"json\" {\n\t\t// Unmarshal the proposal response to add descriptions to mismatch items\n\t\treadinessResult := &lb.CheckCommitReadinessResult{}\n\t\terr := proto.Unmarshal(proposalResponse.Response.Payload, readinessResult)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"failed to unmarshal readiness result\")\n\t\t}\n\n\t\tif c.Input.InspectionEnabled {\n\t\t\tfor org, mismatches := range readinessResult.Mismatches {\n\t\t\t\tfor i, item := range mismatches.Items {\n\t\t\t\t\tmismatches.Items[i] = c.mismatchItemWithDescription(item)\n\t\t\t\t}\n\t\t\t\treadinessResult.Mismatches[org] = mismatches\n\t\t\t}\n\t\t} else {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/lifecycle/chaincode/checkcommitreadiness.go#L168-L204","documentation":"ReadinessCheck sends a CheckCommitReadiness proposal to a peer and expects a successful endorsement response. This error means the peer responded, but with a non-200 (non-SUCCESS) gRPC/protobuf status code in the ProposalResponse, and the response message is embedded in the error text. It is the CLI surfacing a peer-side rejection of the readiness query.","triggerScenarios":"Running `peer lifecycle chaincode checkcommitreadiness` when the peer rejects the proposal: bad channel name, chaincode not defined on the channel, authorization/signature failure, or the peer returns an error status like 500 with a message.","commonSituations":"Misspelled --channelID or --name; user not enrolled/authorized on the channel; endorsing peer down or in a bad state returning 503/500; chaincode package name/sequence mismatch against the committed definition.","solutions":["Read the %s message in the error to see the peer's rejection reason and fix that root cause","Verify --channelID and --name match an existing channel and chaincode definition","Check MSP/identity configuration so the submitting client is authorized on the channel","Try a different --peerAddress in case the target peer is unhealthy"],"exampleFix":"// before\npeer lifecycle chaincode checkcommitreadiness --channelID wrongchan --name mycc --signature-policy ...\n// after\npeer lifecycle chaincode checkcommitreadiness --channelID mychannel --name mycc --signature-policy ...","handlingStrategy":"try-catch","validationCode":"// check channel and chaincode exist before invoking\nif channelID == \"\" || chaincodeName == \"\" { return errors.New(\"channelID and name are required\") }","typeGuard":"if resp.GetResponse() == nil || resp.Response == nil { return errors.New(\"nil proposal response\") }","tryCatchPattern":"err := checker.ReadinessCheck(); if err != nil { var status int32; if strings.HasPrefix(err.Error(), \"query failed with status:\") { fmt.Sscanf(err.Error(), \"query failed with status: %d\", &status); log.Printf(\"peer rejected with status %d\", status) } else { return err } }","preventionTips":["Verify --channelID and --name against `peer channel list` and committed definitions","Ensure client identity/MSP is valid and authorized on the channel","Target a healthy peer first with `peer channel fetch` to confirm connectivity"],"tags":["fabric","chaincode","peer-response"],"backgroundTag":"proposal-response-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"}