hyperledger/fabric · error

nil config parameter

Error message

nil config parameter

What it means

Returned by NewValidatorImpl when the *cb.Config argument is nil. It is an argument-contract guard: the validator needs an existing config to compute and validate deltas against, so a nil baseline config is rejected immediately.

Source

Thrown at common/configtx/validator.go:104

		return errors.Errorf("channel ID illegal, cannot be empty")
	}
	if len(channelID) > MaxLength {
		return errors.Errorf("channel ID illegal, cannot be longer than %d", MaxLength)
	}

	// Illegal characters
	matched := re.FindString(channelID)
	if len(matched) != len(channelID) {
		return errors.Errorf("'%s' contains illegal characters", channelID)
	}

	return nil
}

// NewValidatorImpl constructs a new implementation of the Validator interface.
func NewValidatorImpl(channelID string, config *cb.Config, namespace string, pm policies.Manager) (*ValidatorImpl, error) {
	if config == nil {
		return nil, errors.Errorf("nil config parameter")
	}

	if config.ChannelGroup == nil {
		return nil, errors.Errorf("nil channel group")
	}

	if err := ValidateChannelID(channelID); err != nil {
		return nil, errors.Errorf("bad channel ID: %s", err)
	}

	configMap, err := mapConfig(config.ChannelGroup, namespace)
	if err != nil {
		return nil, errors.Errorf("error converting config to map: %s", err)
	}

	return &ValidatorImpl{
		namespace:   namespace,
		pm:          pm,

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Pass a non-nil config when constructing the validator
  2. Trace the caller to find why the config is nil
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at common/configtx/validator.go:104 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/f0aa9a4b3718ec60. Report an issue: GitHub.