{"record":{"id":"6dadf6a586a396e8","repo":"grpc/grpc-go","slug":"filter-missing-name-field","errorCode":null,"errorMessage":"filter missing name field","messagePattern":"filter missing name field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/xds/xdsclient/xdsresource/unmarshal_lds.go","lineNumber":219,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"filter override %q: %v\", name, err)\n\t\t}\n\t\tif httpFilter == nil {\n\t\t\t// Optional configs are ignored.\n\t\t\tcontinue\n\t\t}\n\t\tm[name] = config\n\t}\n\treturn m, nil\n}\n\nfunc processHTTPFilters(filters []*v3httppb.HttpFilter, server bool) ([]HTTPFilter, error) {\n\tret := make([]HTTPFilter, 0, len(filters))\n\tseenNames := make(map[string]bool, len(filters))\n\tfor _, filter := range filters {\n\t\tname := filter.GetName()\n\t\tif name == \"\" {\n\t\t\treturn nil, errors.New(\"filter missing name field\")\n\t\t}\n\t\tif seenNames[name] {\n\t\t\treturn nil, fmt.Errorf(\"duplicate filter name %q\", name)\n\t\t}\n\t\tseenNames[name] = true\n\n\t\thttpFilter, config, err := validateHTTPFilterConfig(filter.GetTypedConfig(), true, filter.GetIsOptional())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif httpFilter == nil {\n\t\t\t// Optional configs are ignored.\n\t\t\tcontinue\n\t\t}\n\t\tif server {\n\t\t\tif _, ok := httpFilter.(httpfilter.ServerFilterBuilder); !ok {\n\t\t\t\tif filter.GetIsOptional() {\n\t\t\t\t\tcontinue","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/grpc/grpc-go/blob/0c51461d27177d997e14c642fe18c11668fc09a3/internal/xds/xdsclient/xdsresource/unmarshal_lds.go#L201-L237","documentation":"Thrown by processHTTPFilters while walking the http_filters list in an LDS RouteConfiguration / HTTP connection manager. gRPC requires every HTTP filter to carry a non-empty name so it can be referenced by per-filter overrides and de-duplicated. An empty name on any filter entry aborts unmarshaling of the whole filter list.","triggerScenarios":"An LDS response includes an HttpFilter message whose name field is unset (\"\"), e.g. a typed_config block was attached but the operator forgot the name. Common when hand-editing Envoy filter configs or when a control-plane translation omits auto-generated names.","commonSituations":"Custom HTTP filter (e.g. ext_authz, ext_proc, rbac) added via control plane without a name. Istio EnvoyFilter patch that appends a filter without setting name. Version mismatch where an older control plane emits a filter shape that lacked names.","solutions":["Open the LDS resource and add a unique, non-empty name to every entry in http_filters.","If using Istio EnvoyFilter, ensure each add/patch operation specifies a name for the appended HTTP filter.","Validate the LDS payload with protoc/buf before sending, requiring name != \"\".","After fixing, NACK/response should re-apply cleanly; confirm no duplicate-name error follows."],"exampleFix":"// before\n//   http_filters: [ { typed_config: { ... } } ]\n// after\n//   http_filters: [ { name: \"envoy.filters.http.router\", typed_config: { ... } } ]","handlingStrategy":"validation","validationCode":"// Validate an LDS HttpFilter list before sending/consuming it.\nfunc validateHTTPFilterNames(filters []*envoy_http_pb.HttpFilter) error {\n    seen := map[string]struct{}{}\n    for _, f := range filters {\n        if f.GetName() == \"\" { return fmt.Errorf(\"filter at index missing name\") }\n        if _, dup := seen[f.GetName()]; dup { return fmt.Errorf(\"duplicate filter name %q\", f.GetName()) }\n        seen[f.GetName()] = struct{}{}\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"Catch the error from the LDS watcher callback (WatchListener). Log the listener URL/version; do not retry the same resource. Surface to the control-plane team since the fix is in their config.","preventionTips":["Always name HTTP filters in control-plane templates.","Add a CEL/rego policy in your xDS server that rejects http_filters entries without names.","Diff against the last-known-good LDS resource when a new filter is added."],"tags":["xds","lds","http-filters","config-validation","control-plane"],"backgroundTag":null,"analyzedSha":"0c51461d27177d997e14c642fe18c11668fc09a3","analyzedAt":"2026-08-11T14:49:15.055Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}