{"record":{"id":"1b3b1a1e5e7a57c1","repo":"jaegertracing/jaeger","slug":"failed-to-parse-admin-server-tls-options-w","errorCode":null,"errorMessage":"failed to parse admin server TLS options: %w","messagePattern":"failed to parse admin server TLS options: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/flags/admin.go","lineNumber":85,"sourceCode":"\n// setLogger initializes logger.\nfunc (s *AdminServer) setLogger(logger *zap.Logger) {\n\ts.logger = logger\n}\n\n// AddFlags registers CLI flags.\nfunc (s *AdminServer) AddFlags(flagSet *flag.FlagSet) {\n\tflagSet.String(adminHTTPHostPort, s.serverCfg.NetAddr.Endpoint, fmt.Sprintf(\"The host:port (e.g. 127.0.0.1%s or %s) for the admin server, including health check, /metrics, etc.\", s.serverCfg.NetAddr.Endpoint, s.serverCfg.NetAddr.Endpoint))\n\ttlsAdminHTTPFlagsConfig.AddFlags(flagSet)\n}\n\n// InitFromViper initializes the server with properties retrieved from Viper.\nfunc (s *AdminServer) initFromViper(v *viper.Viper, logger *zap.Logger) error {\n\ts.setLogger(logger)\n\n\ttlsAdminHTTP, err := tlsAdminHTTPFlagsConfig.InitFromViper(v)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse admin server TLS options: %w\", err)\n\t}\n\n\ts.serverCfg.NetAddr.Endpoint = v.GetString(adminHTTPHostPort)\n\ts.serverCfg.TLS = tlsAdminHTTP\n\treturn nil\n}\n\n// Handle adds a new handler to the admin server.\nfunc (s *AdminServer) Handle(path string, handler http.Handler) {\n\ts.mux.Handle(path, handler)\n}\n\n// Serve starts HTTP server.\nfunc (s *AdminServer) Serve() error {\n\tl, err := s.serverCfg.ToListener(context.Background())\n\tif err != nil {\n\t\ts.logger.Error(\"Admin server failed to listen\", zap.Error(err))\n\t\treturn err","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/internal/flags/admin.go#L67-L103","documentation":"AdminServer.initFromViper parses the admin HTTP server's TLS flags (tlsAdminHTTPFlagsConfig.InitFromViper). If those TLS options are invalid — bad cert/key file references, malformed values — the error is wrapped as \"failed to parse admin server TLS options\". It occurs before the admin server starts, so the whole service fails to boot.","triggerScenarios":"Setting --admin.http.tls.enabled=true without providing a certificate/key, pointing to nonexistent cert/key files, or supplying malformed TLS flag values that the tls config parser rejects.","commonSituations":"Mount not present in the pod so cert paths are empty; enabled TLS with self-signed cert paths typed incorrectly; user disables TLS but leaves stale cert flags that fail validation; typo in flag name.","solutions":["Check the wrapped cause: it names the invalid TLS field or unreadable file.","Verify cert/key file paths exist and are readable inside the container.","If TLS is not needed, remove the TLS flags or set --admin.http.tls.enabled=false.","Align the secret mount names/paths in the deployment with the flags."],"exampleFix":"// before\n--admin.http.tls.enabled=true --admin.http.tls.cert=/missing/tls.crt\n// after\n--admin.http.tls.enabled=true --admin.http.tls.cert=/etc/jaeger/tls/tls.crt --admin.http.tls.key=/etc/jaeger/tls/tls.key","handlingStrategy":"validation","validationCode":"if tlsCfg.Enabled {\n    for _, p := range []string{tlsCfg.CertPath, tlsCfg.KeyPath} {\n        if _, err := os.Stat(p); err != nil {\n            return fmt.Errorf(\"TLS file missing: %s\", p)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := svc.Start(viper); err != nil {\n    if strings.Contains(err.Error(), \"admin server TLS options\") {\n        // inspect --admin.http.tls.* flags\n    }\n    log.Fatal(err)\n}","preventionTips":["Mount TLS secrets before the process starts and verify paths exist.","Only set --admin.http.tls.enabled=true when cert/key are provided.","Keep TLS flag values in a validated config file, not hand-edited args.","Run a dry start locally with the same flags."],"tags":["tls","config","admin-server"],"backgroundTag":"tls-config-parse-failed","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}