hyperledger/fabric · error

failed creating MSPRole_CLIENT

Error message

failed creating MSPRole_CLIENT

What it means

postSetupV11 wraps a proto.Marshal failure while building the MSPRole_CLIENT principal used to check that admin certificates carry the client OU. Marshalling a just-constructed small protobuf is practically infallible; failure signals a programming error or corrupted protobuf runtime state.

Solutions

  1. Inspect the wrapped proto.Marshal error for the exact cause
  2. Verify msp.name and the MSPRole message construction in postSetupV11
  3. Treat as a bug: report or fix rather than retry, since input data does not vary
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at msp/mspimplsetup.go:688 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at msp/mspimplsetup.go:688

	err = msp.postSetupV142(conf)
	if err != nil {
		return err
	}

	return nil
}

func (msp *bccspmsp) postSetupV11(conf *m.FabricMSPConfig) error {
	// Check for OU enforcement
	if !msp.ouEnforcement {
		// No enforcement required. Call post setup as per V1
		return msp.postSetupV1(conf)
	}

	// Check that admins are clients
	principalBytes, err := proto.Marshal(&m.MSPRole{Role: m.MSPRole_CLIENT, MspIdentifier: msp.name})
	if err != nil {
		return errors.Wrapf(err, "failed creating MSPRole_CLIENT")
	}
	principal := &m.MSPPrincipal{
		PrincipalClassification: m.MSPPrincipal_ROLE,
		Principal:               principalBytes,
	}
	for i, admin := range msp.admins {
		err = admin.SatisfiesPrincipal(principal)
		if err != nil {
			return errors.WithMessagef(err, "admin %d is invalid", i)
		}
	}

	return nil
}

func (msp *bccspmsp) postSetupV142(conf *m.FabricMSPConfig) error {
	// Check for OU enforcement
	if !msp.ouEnforcement {

View on GitHub (pinned to 2736b63f8f)