{"record":{"id":"bcb47483270bff47","repo":"jaegertracing/jaeger","slug":"cannot-start-the-admin-server-w","errorCode":null,"errorMessage":"cannot start the admin server: %w","messagePattern":"cannot start the admin server: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/flags/service.go","lineNumber":105,"sourceCode":"\ts.MetricsFactory = metricsFactory\n\n\tif err = s.Admin.initFromViper(v, s.Logger); err != nil {\n\t\treturn fmt.Errorf(\"cannot initialize admin server: %w\", err)\n\t}\n\tif h := metricsBuilder.Handler(); h != nil {\n\t\troute := metricsBuilder.HTTPRoute\n\t\ts.Logger.Info(\"Mounting metrics handler on admin server\", zap.String(\"route\", route))\n\t\ts.Admin.Handle(route, h)\n\t}\n\n\t// Mount expvar routes on different backends\n\tif metricsBuilder.Backend != \"expvar\" {\n\t\ts.Logger.Info(\"Mounting expvar handler on admin server\", zap.String(\"route\", \"/debug/vars\"))\n\t\ts.Admin.Handle(\"/debug/vars\", expvar.Handler())\n\t}\n\n\tif err := s.Admin.Serve(); err != nil {\n\t\treturn fmt.Errorf(\"cannot start the admin server: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// RunAndThen sets the health check to Ready and blocks until SIGTERM is received.\n// It then runs the shutdown function and exits.\nfunc (s *Service) RunAndThen(shutdown func()) error {\n\ts.Admin.Host().Ready()\n\n\t<-s.signalsChannel\n\n\ts.Logger.Info(\"Shutting down\")\n\ts.Admin.Host().SetUnavailable()\n\n\tif shutdown != nil {\n\t\tshutdown()\n\t}","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/internal/flags/service.go#L87-L123","documentation":"This error wraps a failure from s.Admin.Serve(), which binds and starts the admin HTTP server during flags.Start(). Serve opens the configured host:port and serves health-check and metrics routes; if the listener cannot be created or served, Jaeger returns this error instead of continuing to run the main service.","triggerScenarios":"Calling flags.Start() when the admin port is already bound by another process, the host:port is unbindable (privileged port without permission, invalid host), or the listener closes with an error other than http.ErrServerClosed during startup.","commonSituations":"Two Jaeger instances on the same host both using default admin port 14269; a leftover process holding the port; running in a container with a port already published; host-port configured to a privileged port as non-root.","solutions":["Free port 14269 (or your configured jaeger.admin.http.host-port): kill the process holding it, e.g. `lsof -i :14269` then stop that process","Change jaeger.admin.http.host-port in the config to a free port","Run as a user allowed to bind the port, or use an unprivileged port (>1024)","Read the wrapped `%w` cause — it will typically say `address already in use` or `permission denied`"],"exampleFix":"// before (config.yaml)\njaeger:\n  admin:\n    http:\n      host-port: \":14269\"  # already in use\n// after\njaeger:\n  admin:\n    http:\n      host-port: \":14270\"","handlingStrategy":"try-catch","validationCode":"// Check the admin port is free before starting\naddr := v.GetString(\"jaeger.admin.http.host-port\")\nif addr == \"\" { addr = \":14269\" }\nif ln, err := net.Listen(\"tcp\", addr); err != nil {\n    return fmt.Errorf(\"admin port %s unavailable: %w\", addr, err)\n} else {\n    ln.Close()\n}","typeGuard":null,"tryCatchPattern":"if err := svc.Start(v); err != nil {\n    var oe *net.OpError\n    if errors.As(err, &oe) && errors.Is(oe.Err, syscall.EADDRINUSE) {\n        log.Fatalf(\"admin port in use; free it or change jaeger.admin.http.host-port: %v\", err)\n    }\n    return err\n}","preventionTips":["Reserve a unique admin port per Jaeger process on the host","Check for stale processes/containers holding 14269 before redeploy","Avoid privileged ports for the admin server","Use readiness checks so overlapping restarts don't double-bind"],"tags":["network","http-server","port-in-use"],"backgroundTag":"port-already-in-use","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}