{"record":{"id":"2026d8fbe2542231","repo":"jaegertracing/jaeger","slug":"invalid-http-server-host-port-w","errorCode":null,"errorMessage":"invalid HTTP server host:port: %w","messagePattern":"invalid HTTP server host:port: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/jaeger/internal/extension/jaegerquery/internal/server.go","lineNumber":68,"sourceCode":"\tgrpcServer   *grpc.Server\n\thttpServer   *httpServer\n\tbgFinished   sync.WaitGroup\n\ttelset       telemetry.Settings\n}\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 {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/jaeger/internal/extension/jaegerquery/internal/server.go#L50-L86","documentation":"NewServer parses the configured HTTP listener address with net.SplitHostPort before starting servers. If options.HTTP.NetAddr.Endpoint is not a valid host:port (missing port, extra colons, empty string), construction fails with \"invalid HTTP server host:port: %w\". This is a configuration-time error; the server never starts.","triggerScenarios":"NewServer is called (via serveAndCollect during extension Start, or in tests) with an HTTP endpoint string that net.SplitHostPort rejects: empty endpoint, \"://\", \"host:\", \"host:port:extra\", or an unparseable IPv6 form like \"[::1]\" without brackets handled properly.","commonSituations":"Config typo in jaeger_query extension YAML (http.endpoint missing or misspelled), a colon-containing host without brackets for IPv6, an empty string from an environment variable substitution that did not resolve, or port omitted entirely.","solutions":["Fix the http.endpoint in the jaeger_query extension config to a valid host:port, e.g. \":16686\" or \"127.0.0.1:16686\".","Wrap IPv6 hosts in brackets: \"[::1]:16686\".","Verify environment-variable substitutions in the config actually resolve (empty ${VAR} yields an invalid endpoint).","Check the wrapped net.SplitHostPort error for the precise syntax problem."],"exampleFix":"# before\nextensions:\n  jaeger_query:\n    http:\n      endpoint: localhost\n\n# after\nextensions:\n  jaeger_query:\n    http:\n      endpoint: localhost:16686","handlingStrategy":"validation","validationCode":"func validateEndpoint(ep string) error {\n    if ep == \"\" {\n        return errors.New(\"http endpoint is empty\")\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(), \"HTTP server host:port\") {\n        return fmt.Errorf(\"check jaeger_query http.endpoint config: %w\", err)\n    }\n    return err\n}","preventionTips":["Always include an explicit port in http.endpoint (\":16686\" is valid).","Bracket IPv6 hosts: \"[::1]:16686\".","Check that environment-variable substitutions in config resolve to non-empty values before startup."],"tags":["configuration","network","http","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"}