hyperledger/fabric · critical

msp type ${mspType} unknown

Error message

msp type ${mspType} unknown

What it means

loadLocalMSP switches on the configured local MSP provider type (as reported by msp.ProviderTypeToString). Only BCCSP types and IDEMIX are recognized; any other value hits the default case and panics with this message. Note it is a panic, not a returned error, so it terminates the process.

Source

Thrown at msp/mgmt/mgmt.go:117

	newOpts, found := msp.Options[mspType]
	if !found {
		mspLogger.Panicf("msp type %s unknown", mspType)
	}

	mspInst, err := msp.New(newOpts, bccsp)
	if err != nil {
		mspLogger.Fatalf("Failed to initialize local MSP, received err %+v", err)
	}
	switch mspType {
	case msp.ProviderTypeToString(msp.FABRIC):
		mspInst, err = cache.New(mspInst)
		if err != nil {
			mspLogger.Fatalf("Failed to initialize local MSP, received err %+v", err)
		}
	case msp.ProviderTypeToString(msp.IDEMIX):
		// Do nothing
	default:
		panic("msp type " + mspType + " unknown")
	}

	mspLogger.Debugf("Created new local MSP")

	return mspInst
}

// GetIdentityDeserializer returns the IdentityDeserializer for the given chain
func GetIdentityDeserializer(chainID string, cryptoProvider bccsp.BCCSP) msp.IdentityDeserializer {
	if chainID == "" {
		return GetLocalMSP(cryptoProvider)
	}

	return GetManagerForChain(chainID)
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Set the local MSP provider type to a valid value such as the BCCSP type (see msp.ProviderTypeToString constants)
  2. Remove or correct the unknown mspType entry in core.yaml and restart the node
  3. Align Fabric binary and config versions so provider type names match

Example fix

// before
type: unknown-provider
// after
type: bccsp
Defensive patterns

Strategy: validation

Validate before calling

allowed := map[string]bool{"bccsp": true, "idemix": true}
if !allowed[strings.ToLower(cfg.MSP.Provider.Type)] {
    panic(fmt.Sprintf("local MSP type %q not supported in this build", cfg.MSP.Provider.Type))
}

Try / catch

// It is a panic, not an error: guard by validating config before calling GetLocalMSP, and wrap startup with a recover in the supervisor.
func safeStart() { defer func() { if r := recover(); r != nil { log.Fatalf("local MSP init: %v", r) } }(); GetLocalMSP() }

Prevention

When it happens

Trigger: Setting core.yaml msp.provider.type (or invoking mspmgmt with a type string) to an unknown provider string; mixing binaries where provider type constants differ.

Common situations: Peer/orderer config mis-edited to an experimental or removed provider type; copying a config from a different Fabric version that named providers differently.

Related errors


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