grpc/grpc-go · error

fault: nil configuration message provided

Error message

fault: nil configuration message provided

What it means

The fault-injection HTTP filter's parseConfig rejects a nil protobuf message outright (fault.go:82). A nil config is not a meaningful fault configuration, so it is a hard error rather than a silent no-op.

Source

Thrown at internal/xds/httpfilter/fault/fault.go:83

	httpfilter.Register(builder{})
}

type builder struct {
}

type config struct {
	httpfilter.FilterConfig
	config *fpb.HTTPFault
}

func (builder) TypeURLs() []string {
	return []string{"type.googleapis.com/envoy.extensions.filters.http.fault.v3.HTTPFault"}
}

// Parsing is the same for the base config and the override config.
func parseConfig(cfg proto.Message) (httpfilter.FilterConfig, error) {
	if cfg == nil {
		return nil, fmt.Errorf("fault: nil configuration message provided")
	}
	m, ok := cfg.(*anypb.Any)
	if !ok {
		return nil, fmt.Errorf("fault: error parsing config %v: unknown type %T", cfg, cfg)
	}
	msg := new(fpb.HTTPFault)
	if err := m.UnmarshalTo(msg); err != nil {
		return nil, fmt.Errorf("fault: error parsing config %v: %v", cfg, err)
	}
	return config{config: msg}, nil
}

func (builder) ParseFilterConfig(cfg proto.Message) (httpfilter.FilterConfig, error) {
	return parseConfig(cfg)
}

func (builder) ParseFilterConfigOverride(override proto.Message) (httpfilter.FilterConfig, error) {
	return parseConfig(override)

View on GitHub (pinned to 03255a9237)

Solutions

  1. Ensure the xDS fault filter resource always carries a populated envoy.extensions.filters.http.fault.v3.HTTPFault message.
  2. If fault injection should be a no-op for a route, omit the filter from the chain instead of passing nil.
  3. Trace where nil originates (resource decoder) and guard it before calling parseConfig.

Example fix

// before
fc, err := faultBuilder.ParseFilterConfig(nil)

// after: pass an actual HTTPFault wrapped in an Any
anyMsg, _ := anypb.New(&fpb.HTTPFault{Delay: &fpb.FaultDelay{FixedDelay: durationpb.New(time.Second)}})
fc, err := faultBuilder.ParseFilterConfig(anyMsg)
Defensive patterns

Strategy: validation

Validate before calling

if cfg == nil {
    return nil, errors.New("fault: refusing to build with nil config")
}
fc, err := faultBuilder.ParseFilterConfig(cfg)

Try / catch

fc, err := faultBuilder.ParseFilterConfig(cfg)
if err != nil {
    // handle (e.g. log and skip fault filter)
    return err
}

Prevention

When it happens

Trigger: ParseFilterConfig or ParseFilterConfigOverride is invoked with a nil proto.Message for the fault filter.

Common situations: xDS layer forwards an empty/absent typed_struct for the fault filter; programmatic construction passing nil by mistake; a per-route override that omits the fault config.

Related errors


AI-assisted analysis of grpc/grpc-go@03255a9237 (2026-08-07). Data as JSON: /api/errors/092a0d60418031ae. Report an issue: GitHub.