{"record":{"id":"1eebc6c63f261c27","repo":"grpc/grpc-go","slug":"extproc-failed-to-unmarshal-override-v-v","errorCode":null,"errorMessage":"extproc: failed to unmarshal override %v: %v","messagePattern":"extproc: failed to unmarshal override (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/httpfilter/extproc/ext_proc.go","lineNumber":180,"sourceCode":"\t\tdisableImmediateResponse: msg.GetDisableImmediateResponse(),\n\t\tobservabilityMode:        msg.GetObservabilityMode(),\n\t\tfailureModeAllow:         msg.GetFailureModeAllow(),\n\t\tserver:                   server,\n\t\tmutationRules:            mutationRules,\n\t\tallowedHeaders:           allowedHeaders,\n\t\tdisallowedHeaders:        disallowedHeaders,\n\t\tdeferredCloseTimeout:     deferredCloseTimeout,\n\t}, nil\n}\n\nfunc (builder) ParseFilterConfigOverride(ov proto.Message) (httpfilter.FilterConfig, error) {\n\tm, ok := ov.(*anypb.Any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"extproc: error parsing override %v: unknown type %T, want *anypb.Any\", ov, ov)\n\t}\n\tmsg := new(v3procfilterpb.ExtProcPerRoute)\n\tif err := m.UnmarshalTo(msg); err != nil {\n\t\treturn nil, fmt.Errorf(\"extproc: failed to unmarshal override %v: %v\", ov, err)\n\t}\n\toverride := msg.GetOverrides()\n\n\tvar processingModesOpt optional.Optional[processingModes]\n\tif pm := override.GetProcessingMode(); pm != nil {\n\t\tif err := validateBodyProcessingMode(pm); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprocessingModesOpt = optional.New(processingModesFromProto(pm))\n\t}\n\n\tvar serverOpt optional.Optional[xdsresource.GRPCServiceConfig]\n\tif override.GetGrpcService() != nil {\n\t\tserver, err := iextproc.ParseGRPCServiceConfig(override.GetGrpcService())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"extproc: failed to parse grpc_service: %v\", err)\n\t\t}\n\t\tserverOpt = optional.New(server)","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/httpfilter/extproc/ext_proc.go#L162-L198","documentation":"Returned by ParseFilterConfigOverride (ext_proc.go:180) when the per-route ExtProcPerRoute override carried in an xDS resource cannot be unmarshalled from its *anypb.Any wrapper. The filter rejects the route override and the xDS update is discarded. It means the control plane published a malformed or wrong-type override payload for the ext_proc HTTP filter.","triggerScenarios":"Triggered while parsing an HttpFilter typed_config_override of the ext_proc type URL whose *anypb.Any value either has the wrong type_url or is not a validly-encoded envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute message (m.UnmarshalTo(msg) at ext_proc.go:179 fails).","commonSituations":"Control-plane/client proto revision mismatch (server ships an override schema the client's go-control-plane does not recognize), wrong type_url stamped on the Any, a hand-rolled xDS server packing the wrong message into the override, or truncated/corrupt override bytes from a misconfigured management server.","solutions":["Confirm the override *anypb.Any.type_url is exactly type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute.","Align the control plane and the gRPC client on the same envoy/go-control-plane version so the ExtProcPerRoute schema matches.","Dump the raw override bytes (GRPC_GO_XDS_DEBUG logs / management-server debug dump) and verify they decode as ExtProcPerRoute with protoc --decode_raw.","Re-publish the LDS/RDS resource from the control plane after correcting the override payload."],"exampleFix":"// before (control plane): override Any packed with the wrong message\nany := &anypb.Any{TypeUrl: \"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute\"}\nany.MarshalAny(&envoyextensionsfiltershttpextprocv3.ExternalProcessor{}) // wrong type\n\n// after: pack the correct per-route override type\nperRoute := &envoyextensionsfiltershttpextprocv3.ExtProcPerRoute{\n  Override: &envoyextensionsfiltershttpextprocv3.ExtProcOverride{\n    ProcessingMode: &envoyextensionsfiltershttpextprocv3.ProcessingMode{},\n  },\n}\nany, _ := anypb.New(perRoute) // TypeUrl auto-set correctly","handlingStrategy":"validation","validationCode":"// Before publishing an xDS override, confirm the Any is a valid ExtProcPerRoute.\nfunc validateExtProcOverrideAny(a *anypb.Any) error {\n    const want = \"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute\"\n    if a == nil || a.TypeUrl != want {\n        return fmt.Errorf(\"override type_url=%q want %q\", a.GetTypeUrl(), want)\n    }\n    var m envoyextensionsfiltershttpextprocv3.ExtProcPerRoute\n    return a.UnmarshalTo(&m) // returns error iff bytes are malformed\n}","typeGuard":"// Narrow an arbitrary proto.Message to the expected override type before parsing.\nfunc isExtProcPerRouteAny(cfg proto.Message) (*anypb.Any, bool) {\n    a, ok := cfg.(*anypb.Any)\n    if !ok {\n        return nil, false\n    }\n    return a, a.TypeUrl == \"type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExtProcPerRoute\"\n}","tryCatchPattern":"// In control-plane test: assert ParseFilterConfigOverride rejects bad overrides fast.\nif _, err := builder{}.ParseFilterConfigOverride(badAny); err != nil {\n    if strings.Contains(err.Error(), \"failed to unmarshal override\") {\n        // expected: reject before publishing\n    }\n}","preventionTips":["Always construct overrides with anypb.New(&ExtProcPerRoute{...}) so the type_url is set automatically.","Pin control-plane and client to the same go-control-plane module version.","Add a CI step that round-trips every published override through ParseFilterConfigOverride.","Enable GRPC_GO_XDS_DEBUG logging in staging to catch malformed overrides early."],"tags":["grpc","xds","extproc","envoy","config","protobuf","proto3"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}