grpc/grpc-go · error

fault: error parsing config %v: %v

Error message

fault: error parsing config %v: %v

What it means

After confirming the config is an *anypb.Any, parseConfig unmarshals it into envoy.extensions.filters.http.fault.v3.HTTPFault (fault.go:90). If UnmarshalTo fails, the payload is malformed, has the wrong type URL, or is corrupt.

Source

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

	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)
}

func (builder) IsTerminal() bool {
	return false
}

func (builder) BuildClientFilter(httpfilter.ClientFilterOptions) httpfilter.ClientFilter {
	return clientFilter{}

View on GitHub (pinned to 03255a9237)

Solutions

  1. Validate the Any.TypeURL equals type.googleapis.com/envoy.extensions.filters.http.fault.v3.HTTPFault before decoding.
  2. Regenerate the fault config from a control plane whose protobuf definitions match the client's go-control-plane version.
  3. Inspect the raw bytes/size of the failing Any to detect truncation or corruption.

Example fix

// before: Any with mismatched type URL or corrupt bytes
anyMsg := &anypb.Any{TypeUrl: "type.googleapis.com/wrong.Type", Value: corruptBytes}

// after: correct type URL and a validly-marshaled HTTPFault
anyMsg, _ := anypb.New(&fpb.HTTPFault{Abort: &fpb.FaultAbort{HttpStatus: &corev3.HttpStatus{Code: corev3.StatusCode_GatewayError}}})
Defensive patterns

Strategy: validation

Validate before calling

if cfg.(*anypb.Any).TypeUrl != "type.googleapis.com/envoy.extensions.filters.http.fault.v3.HTTPFault" {
    return nil, errors.New("wrong type URL for fault config")
}

Try / catch

fc, err := faultBuilder.ParseFilterConfig(cfg)
if err != nil {
    // log type URL + byte length to diagnose corruption
    return err
}

Prevention

When it happens

Trigger: The Any payload does not deserialize as HTTPFault: wrong type URL, truncated bytes, schema-incompatible content, or a proto version mismatch.

Common situations: xDS server sends a fault config generated by an incompatible protobuf; hand-crafted Any with the wrong type URL; network/serialization corruption; using an old control plane with a new go-control-plane.

Related errors


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