{"record":{"id":"aff1c26d2bc4679b","repo":"jaegertracing/jaeger","slug":"invalid-grpc-server-host-port-w","errorCode":null,"errorMessage":"invalid gRPC server host:port: %w","messagePattern":"invalid gRPC server host:port: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/server.go","lineNumber":72,"sourceCode":"}\n\n// NewServer creates and initializes Server.\nfunc NewServer(\n\tctx context.Context,\n\tquerySvc *querysvc.QueryService,\n\tmetricsQuerySvc metricstore.Reader,\n\toptions *QueryOptions,\n\tbackendCaps BackendCapabilityProvider,\n\ttm *tenancy.Manager,\n\ttelset telemetry.Settings,\n) (*Server, error) {\n\t_, httpPort, err := net.SplitHostPort(options.HTTP.NetAddr.Endpoint)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid HTTP server host:port: %w\", err)\n\t}\n\t_, grpcPort, err := net.SplitHostPort(options.GRPC.NetAddr.Endpoint)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid gRPC server host:port: %w\", err)\n\t}\n\tseparatePorts := grpcPort != httpPort || grpcPort == \"0\" || httpPort == \"0\"\n\n\tif (options.HTTP.TLS.HasValue() || options.GRPC.TLS.HasValue()) && !separatePorts {\n\t\treturn nil, errors.New(\"server with TLS enabled can not use same host ports for gRPC and HTTP.  Use dedicated HTTP and gRPC host ports instead\")\n\t}\n\n\tgrpcServer, err := createGRPCServer(ctx, options, tm, telset)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tregisterGRPCHandlers(grpcServer, querySvc, telset)\n\thttpServer, err := createHTTPServer(ctx, querySvc, metricsQuerySvc, options, backendCaps, tm, telset)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Server{","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/server.go#L54-L90","documentation":"NewServer likewise validates the gRPC listener address with net.SplitHostPort. If options.GRPC.NetAddr.Endpoint is not a valid host:port, construction fails with \"invalid gRPC server host:port: %w\". Like the HTTP variant it is a fail-fast configuration error before any listener is created.","triggerScenarios":"NewServer (via serveAndCollect or tests) receives a gRPC endpoint net.SplitHostPort cannot parse: empty string, bare host with no port, multiple colons, or malformed IPv6 literal without brackets.","commonSituations":"grpc.endpoint omitted or left empty in the jaeger_query extension config, environment variable substitution producing an empty value, IPv6 address written unbracketed, or accidental paste of a URL (\"http://host:port\") into the endpoint field.","solutions":["Fix grpc.endpoint to a valid host:port, e.g. \":16685\" or \"127.0.0.1:16685\".","Bracket IPv6 hosts: \"[::1]:16685\".","Ensure ${ENV} substitutions used in the endpoint resolve to non-empty values.","Check the wrapped net.SplitHostPort error for the exact syntax issue; also confirm the HTTP variant (error 213) passes if using a shared port."],"exampleFix":"# before\nextensions:\n  jaeger_query:\n    grpc:\n      endpoint: ${JAEGER_GRPC}\n# (JAEGER_GRPC unset -> empty endpoint)\n\n# after\nextensions:\n  jaeger_query:\n    grpc:\n      endpoint: 127.0.0.1:16685","handlingStrategy":"validation","validationCode":"func validateGRPCEndpoint(ep string) error {\n    if ep == \"\" {\n        return errors.New(\"grpc endpoint is empty\")\n    }\n    if strings.Contains(ep, \"://\") {\n        return errors.New(\"grpc endpoint must be host:port, not a URL\")\n    }\n    _, _, err := net.SplitHostPort(ep)\n    return err\n}","typeGuard":"func hasHostPort(ep string) bool {\n    _, port, err := net.SplitHostPort(ep)\n    return err == nil && port != \"\"\n}","tryCatchPattern":"srv, err := NewServer(params, caps, tm, telset)\nif err != nil {\n    var addrErr *net.AddrError\n    if errors.As(err, &addrErr) && strings.Contains(err.Error(), \"gRPC server host:port\") {\n        return fmt.Errorf(\"check jaeger_query grpc.endpoint config: %w\", err)\n    }\n    return err\n}","preventionTips":["Always include an explicit port in grpc.endpoint (\":16685\").","Do not paste URLs into endpoint fields; use bare host:port.","Bracket IPv6 hosts and verify env substitutions resolve before startup."],"tags":["configuration","network","grpc","startup"],"backgroundTag":"invalid-address-format","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}