hyperledger/fabric · error

Must set some OrdererAddresses

Error message

Must set some OrdererAddresses

What it means

ChannelConfig requires at least one global orderer address in the OrdererAddresses config value; validateOrdererAddresses returns this error when the list is empty. Orderer addresses are how clients locate the ordering service for the channel, so an empty list makes the config unusable for submission/delivery.

Source

Thrown at common/channelconfig/channel.go:221

	case bccsp.SHA3_256:
		cc.hashingAlgorithm = util.ComputeSHA3256
	default:
		return fmt.Errorf("Unknown hashing algorithm type: %s", cc.protos.HashingAlgorithm.Name)
	}

	return nil
}

func (cc *ChannelConfig) validateBlockDataHashingStructure() error {
	if cc.protos.BlockDataHashingStructure.Width != math.MaxUint32 {
		return fmt.Errorf("BlockDataHashStructure width only supported at MaxUint32 in this version")
	}
	return nil
}

func (cc *ChannelConfig) validateOrdererAddresses() error {
	if len(cc.protos.OrdererAddresses.Addresses) == 0 {
		return fmt.Errorf("Must set some OrdererAddresses")
	}
	return nil
}

func (cc *ChannelConfig) validateNoOrdererAddresses() error {
	if len(cc.protos.OrdererAddresses.Addresses) > 0 {
		return fmt.Errorf("global OrdererAddresses are not allowed with V3_0 capability, use org specific addresses only")
	}
	return nil
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Add orderer host:port entries under Channel: OrdererAddresses (or via Orderer: Endpoints in newer configtx.yaml) and regenerate
  2. In code/tests, populate &cb.OrdererAddresses{Addresses: []string{"host:port"}} in the channel group values
  3. If decoding existing config, confirm the OrdererAddresses value exists and its Addresses list is non-empty

Example fix

# before
Channel: {} # no OrdererAddresses -> error

# after
Channel:
    OrdererAddresses:
        - orderer.example.com:7050
Defensive patterns

Strategy: validation

Validate before calling

if channelGroup.Values["OrdererAddresses"] == nil {
    return errors.New("channel config must include OrdererAddresses")
}
oa := &cb.OrdererAddresses{}
_ = proto.Unmarshal(channelGroup.Values["OrdererAddresses"].Value, oa)
if len(oa.Addresses) == 0 {
    return errors.New("OrdererAddresses list is empty")
}

Try / catch

cc, err := channelconfig.NewChannelConfig(channelGroup, bccsp)
if err != nil {
    if strings.Contains(err.Error(), "Must set some OrdererAddresses") {
        return fmt.Errorf("add at least one orderer endpoint to the config")
    }
    return err
}

Prevention

When it happens

Trigger: Validate (called from NewChannelConfig) runs validateOrdererAddresses and cc.protos.OrdererAddresses.Addresses has length 0 — the OrdererAddresses value is absent from the Channel group or was created with an empty Addresses slice. Tests hit it via TestOrdererAddresses.

Common situations: configtx.yaml missing Orderer.Addresses / Consenter mappings; stripping the value during configtxlator edits; building channel config in tests without setting OrdererAddresses.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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