hyperledger/fabric · error

error checking chaincode instantiation policy: MSP manager f

Error message

error checking chaincode instantiation policy: MSP manager for channel %s not found

What it means

CheckInstantiationPolicy validates a signed proposal against a chaincode's instantiation policy. It needs the channel's identity deserializer, which comes from the channel's MSP manager. If the deserializer is nil, the MSP manager for that channel does not exist, so the policy cannot be evaluated and this error is thrown.

Source

Thrown at core/scc/lscc/support.go:78

		// to be able to instantiate
		mspids := s.GetMSPIDs(channel)

		p := policydsl.SignedByAnyAdmin(mspids)
		ip, err = protoutil.Marshal(p)
		if err != nil {
			return nil, errors.Errorf("error marshalling default instantiation policy")
		}
	}
	return ip, nil
}

// CheckInstantiationPolicy checks whether the supplied signed proposal
// complies with the supplied instantiation policy
func (s *SupportImpl) CheckInstantiationPolicy(signedProp *pb.SignedProposal, chainName string, instantiationPolicy []byte) error {
	// create a policy object from the policy bytes
	idd := s.GetIdentityDeserializer(chainName)
	if idd == nil {
		return errors.Errorf("error checking chaincode instantiation policy: MSP manager for channel %s not found", chainName)
	}
	npp := cauthdsl.NewPolicyProvider(idd)
	instPol, _, err := npp.NewPolicy(instantiationPolicy)
	if err != nil {
		return err
	}
	proposal, err := protoutil.UnmarshalProposal(signedProp.ProposalBytes)
	if err != nil {
		return err
	}
	// get the signature header of the proposal
	header, err := protoutil.UnmarshalHeader(proposal.Header)
	if err != nil {
		return err
	}
	shdr, err := protoutil.UnmarshalSignatureHeader(header.SignatureHeader)
	if err != nil {
		return err

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Ensure the peer has joined the channel (peer channel join) before instantiate
  2. Verify the channel name passed matches an existing joined channel exactly
  3. Check that the channel genesis/config with MSP definitions loaded correctly in peer logs
  4. Restart the peer so channel resources (including MSP manager) are initialized
Defensive patterns

Strategy: validation

Validate before calling

// verify the peer has joined the channel and MSP manager exists first
// e.g. run: peer channel list | grep <channelName>
// and confirm channel config with MSPs was loaded

Try / catch

if err := lscc.CheckInstantiationPolicy(signedProp, chainName, instPolicy); err != nil {
    if strings.Contains(err.Error(), "MSP manager for channel") {
        // channel not joined / not initialized: join channel or fix channel name
    }
    return err
}

Prevention

When it happens

Trigger: Calling CheckInstantiationPolicy (e.g. during LSCC deploy/instantiate validation) with a chainName for which GetIdentityDeserializer returns nil — i.e. the channel is unknown to the peer or its MSP manager has not been initialized.

Common situations: Instantiating chaincode on a channel the peer has not joined; channel config/MSP not yet loaded; typo in channel name; peer restarted before channel resources were restored.

Related errors


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