{"record":{"id":"155074cb7ce1f43c","repo":"grpc/grpc-go","slug":"missing-server-listener-resource-name-template-in","errorCode":null,"errorMessage":"missing server_listener_resource_name_template in the bootstrap configuration","messagePattern":"missing server_listener_resource_name_template in the bootstrap configuration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xds/server.go","lineNumber":111,"sourceCode":"\t// Initializing the xDS client upfront (instead of at serving time)\n\t// simplifies the code by eliminating the need for a mutex to protect the\n\t// xdsC and xdsClientClose fields.\n\tpool := xdsClientPool\n\tif s.opts.clientPoolForTesting != nil {\n\t\tpool = s.opts.clientPoolForTesting\n\t}\n\txdsClient, xdsClientClose, err := pool.NewClient(xdsclient.NameForServer, mrl)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"xDS client creation failed: %v\", err)\n\t}\n\n\t// Validate the bootstrap configuration for server specific fields.\n\n\t// Listener resource name template is mandatory on the server side.\n\tcfg := xdsClient.BootstrapConfig()\n\tif cfg.ServerListenerResourceNameTemplate() == \"\" {\n\t\txdsClientClose()\n\t\treturn nil, errors.New(\"missing server_listener_resource_name_template in the bootstrap configuration\")\n\t}\n\n\ts.xdsC = xdsClient\n\ts.xdsClientClose = xdsClientClose\n\n\ts.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf(serverPrefix, s))\n\ts.logger.Infof(\"Created xds.GRPCServer\")\n\n\treturn s, nil\n}\n\n// handleServerOptions iterates through the list of server options passed in by\n// the user, and handles the xDS server specific options.\nfunc (s *GRPCServer) handleServerOptions(opts []grpc.ServerOption) {\n\tso := s.defaultServerOptions()\n\tfor _, opt := range opts {\n\t\tif o, ok := opt.(*serverOption); ok {\n\t\t\to.apply(so)","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/grpc/grpc-go/blob/03255a9237b6eb32710f6bc4f2de9a675b99fe36/xds/server.go#L93-L129","documentation":"Returned by xds.NewGRPCServer (xds/server.go:111) when the xDS bootstrap configuration does not provide a server_listener_resource_name_template. On the server side, this template is mandatory because it tells the xDS client how to request the Listener resource for the server's listener. Without it the xDS server cannot be configured, so construction fails.","triggerScenarios":"Creating an xds.GRPCServer while the bootstrap config (file or env GOOGLE_ANX_BOOSTRAP / GRPC_XDS_BOOTSTRAP) lacks the x_servers[].server_listener_resource_name_template field, or that field resolves to an empty string.","commonSituations":"Using a client-only bootstrap file for an xDS server; misgenerated bootstrap from a control plane; typo in the field name; bootstrap env var pointing at the wrong file.","solutions":["Add server_listener_resource_name_template (e.g. \"grpc/server?xds.resource.listening_address=%s\") to the x_servers section of your bootstrap JSON.","Ensure the GRPC_XDS_BOOTSTRAP / GRPC_XDS_BOOTSTRAP_FILE env var points to a bootstrap that includes server-side config.","Regenerate the bootstrap from your control plane with server mode enabled.","Verify the template is non-empty after bootstrap parsing (it must not be \"\")."],"exampleFix":"// before - bootstrap.json has only \"xds_servers\", no \"x_servers\"\n\n// after - add the servers section\n{\n  \"xds_servers\": [...],\n  \"x_servers\": [\n    {\n      \"server_listener_resource_name_template\": \"grpc/server?xds.resource.listening_address=%s\"\n    }\n  ]\n}","handlingStrategy":"validation","validationCode":"cfg, _ := xdsclient.Get()\nbc := cfg.BootstrapConfig()\nif bc == nil || bc.ServerListenerResourceNameTemplate() == \"\" {\n    log.Fatal(\"bootstrap missing server_listener_resource_name_template\")\n}","typeGuard":null,"tryCatchPattern":"srv := xds.NewGRPCServer()\nif _, err := srv.Serve(lis); err != nil {\n    if strings.Contains(err.Error(), \"server_listener_resource_name_template\") {\n        log.Fatalf(\"fix bootstrap config: %v\", err)\n    }\n}","preventionTips":["Use a bootstrap config that includes the x_servers.server_listener_resource_name_template field for servers.","Keep separate client and server bootstrap files if roles differ.","Validate the bootstrap JSON at deploy time."],"tags":["go","grpc","xds","bootstrap","config"],"analyzedSha":"03255a9237b6eb32710f6bc4f2de9a675b99fe36","analyzedAt":"2026-08-07T00:29:34.215Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}