hyperledger/fabric · error

Cannot create proposal, due to %s

Error message

Cannot create proposal, due to %s

What it means

Returned by getChannels (the implementation behind `peer channel list`) when building the GetChannels endorser proposal fails. The CLI serializes the signer identity and calls protoutil.CreateProposalFromCIS; any failure is wrapped with the cause.

Source

Thrown at internal/peer/channel/list.go:58

	}
}

func (cc *endorserClient) getChannels() ([]*pb.ChannelInfo, error) {
	var err error

	invocation := &pb.ChaincodeInvocationSpec{
		ChaincodeSpec: &pb.ChaincodeSpec{
			Type:        pb.ChaincodeSpec_Type(pb.ChaincodeSpec_Type_value["GOLANG"]),
			ChaincodeId: &pb.ChaincodeID{Name: "cscc"},
			Input:       &pb.ChaincodeInput{Args: [][]byte{[]byte(cscc.GetChannels)}},
		},
	}

	var prop *pb.Proposal
	c, _ := cc.cf.Signer.Serialize()
	prop, _, err = protoutil.CreateProposalFromCIS(common2.HeaderType_ENDORSER_TRANSACTION, "", invocation, c)
	if err != nil {
		return nil, fmt.Errorf("Cannot create proposal, due to %s", err)
	}

	var signedProp *pb.SignedProposal
	signedProp, err = protoutil.GetSignedProposal(prop, cc.cf.Signer)
	if err != nil {
		return nil, fmt.Errorf("Cannot create signed proposal, due to %s", err)
	}

	proposalResp, err := cc.cf.EndorserClient.ProcessProposal(context.Background(), signedProp)
	if err != nil {
		return nil, fmt.Errorf("Failed sending proposal, got %s", err)
	}

	if proposalResp.Response == nil || proposalResp.Response.Status != http.StatusOK {
		return nil, fmt.Errorf("Received bad response, status %d: %s", proposalResp.Response.Status, proposalResp.Response.Message)
	}

	var channelQueryResponse pb.ChannelQueryResponse

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Read the wrapped cause in the %s for the specific failure
  2. Verify MSP directory layout (signcerts + keystore present and valid)
  3. Re-enroll the identity if certificates are expired or malformed
  4. Ensure the correct -f/--mspdir and connection flags are used

Example fix

// before: c serialized with ignored error
c, _ := cc.cf.Signer.Serialize()
prop, _, err = protoutil.CreateProposalFromCIS(common2.HeaderType_ENDORSER_TRANSACTION, "", invocation, c)
// after
c, err := cc.cf.Signer.Serialize()
if err != nil { return nil, fmt.Errorf("cannot serialize signer: %w", err) }
Defensive patterns

Strategy: validation

Validate before calling

// pre-flight: signer must serialize before proposal creation
if _, err := cc.cf.Signer.Serialize(); err != nil {
    return fmt.Errorf("signer identity invalid, cannot build GetChannels proposal: %w", err)
}

Try / catch

prop, _, err := protoutil.CreateProposalFromCIS(common2.HeaderType_ENDORSER_TRANSACTION, "", invocation, c)
if err != nil {
    return nil, fmt.Errorf("Cannot create proposal, due to %s", err)
}

Prevention

When it happens

Trigger: CreateProposalFromCIS returns an error while constructing the ENDORSER_TRANSACTION proposal for the qscc GetChannels invocation — malformed invocation spec or the signer identity cannot be serialized/used.

Common situations: Broken MSP config so the signer's identity can't be built; corrupted crypto material in the MSP directory; running the CLI outside a properly configured peer client context.

Related errors


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