hyperledger/fabric · error

error converting envelope to config update: %s

Error message

error converting envelope to config update: %s

What it means

This error is returned by ValidatorImpl.proposeConfigUpdate when the submitted envelope cannot be unmarshaled into a ConfigUpdateEnvelope. It means the payload of the config update transaction is malformed or not a valid protobuf envelope, so the validator never even attempts authorization. It is a defensive wrapper (via errors.Errorf with %s) preserving the underlying unmarshal error.

Source

Thrown at common/configtx/validator.go:139

		namespace:   namespace,
		pm:          pm,
		sequence:    config.Sequence,
		configMap:   configMap,
		channelID:   channelID,
		configProto: config,
	}, nil
}

// ProposeConfigUpdate takes in an Envelope of type CONFIG_UPDATE and produces a
// ConfigEnvelope to be used as the Envelope Payload Data of a CONFIG message
func (vi *ValidatorImpl) ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error) {
	return vi.proposeConfigUpdate(configtx)
}

func (vi *ValidatorImpl) proposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error) {
	configUpdateEnv, err := protoutil.EnvelopeToConfigUpdate(configtx)
	if err != nil {
		return nil, errors.Errorf("error converting envelope to config update: %s", err)
	}

	configMap, err := vi.authorizeUpdate(configUpdateEnv)
	if err != nil {
		return nil, errors.Errorf("error authorizing update: %s", err)
	}

	channelGroup, err := configMapToConfig(configMap, vi.namespace)
	if err != nil {
		return nil, errors.Errorf("could not turn configMap back to channelGroup: %s", err)
	}

	return &cb.ConfigEnvelope{
		Config: &cb.Config{
			Sequence:     vi.sequence + 1,
			ChannelGroup: channelGroup,
		},
		LastUpdate: configtx,

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Verify the envelope payload unmarshals to cb.ConfigUpdateEnvelope (check protoutil.EnvelopeToConfigUpdate on the input before submitting).
  2. Regenerate the envelope with a matching Fabric proto library / SDK version compatible with the orderer.
  3. Ensure the envelope is built from a proper config update (e.g., configtxlator or channel.Update call), not an arbitrary transaction.
  4. Log the underlying %s cause to pinpoint the exact unmarshal failure.

Example fix

// before
cfgUpdate := &cb.ConfigUpdate{...}
env := &cb.Envelope{Payload: nil} // malformed
orderer.ProposeConfigUpdate(env)
// after
env, err := protoutil.CreateSignedEnvelope(cb.HeaderType_CONFIG_UPDATE, channelID, signer, cfgUpdate, 0, 0)
if err != nil { return err }
orderer.ProposeConfigUpdate(env)
Defensive patterns

Strategy: validation

Validate before calling

if env == nil || len(env.Payload) == 0 { return errors.New("empty config update envelope") }
cue := &cb.ConfigUpdateEnvelope{}
if err := proto.Unmarshal(env.Payload, cue); err != nil { return fmt.Errorf("payload is not a ConfigUpdateEnvelope: %w", err) }

Type guard

func isValidEnvelope(env *cb.Envelope) bool { return env != nil && len(env.Payload) > 0 }

Try / catch

result, err := validator.ProposeConfigUpdate(env)
if err != nil && strings.Contains(err.Error(), "error converting envelope to config update") {
    // rebuild envelope from a proper ConfigUpdate via protoutil.CreateSignedEnvelope
}

Prevention

When it happens

Trigger: Calling ProposeConfigUpdate with an envelope whose payload is nil, not a marshaled cb.ConfigUpdateEnvelope, truncated/corrupted bytes, or an envelope produced by a different/incompatible proto schema version.

Common situations: Clients constructing config update transactions by hand with incorrect marshaling; envelopes that were signed/modified incorrectly; cross-version Fabric SDKs producing proto payloads the orderer cannot parse; submitting an ordinary transaction envelope instead of a config update envelope.

Understand the failure class

Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.

Related errors


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