{"record":{"id":"8e649ebcc5e695e4","repo":"jaegertracing/jaeger","slug":"abnormal-value-of-http-status-code-v","errorCode":null,"errorMessage":"abnormal value of http status code: %v","messagePattern":"abnormal value of http status code: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/internal/status/command.go","lineNumber":42,"sourceCode":"func Command(v *viper.Viper, adminPort int) *cobra.Command {\n\tc := &cobra.Command{\n\t\tUse:   \"status\",\n\t\tShort: \"Print the status.\",\n\t\tLong:  `Print Jaeger component status information, exit non-zero on any error.`,\n\t\tRunE: func(_ *cobra.Command, _ /* args */ []string) error {\n\t\t\turl := convert(v.GetString(statusHTTPHostPort))\n\t\t\tctx, cx := context.WithTimeout(context.Background(), time.Second)\n\t\t\tdefer cx()\n\t\t\treq, _ := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody)\n\t\t\tresp, err := http.DefaultClient.Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer resp.Body.Close()\n\t\t\tbody, _ := io.ReadAll(resp.Body)\n\t\t\tfmt.Println(string(body))\n\t\t\tif resp.StatusCode != http.StatusOK {\n\t\t\t\treturn fmt.Errorf(\"abnormal value of http status code: %v\", resp.StatusCode)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\tc.Flags().AddGoFlagSet(flags(&flag.FlagSet{}, adminPort))\n\tv.BindPFlags(c.Flags())\n\treturn c\n}\n\nfunc flags(flagSet *flag.FlagSet, adminPort int) *flag.FlagSet {\n\tadminPortStr := ports.PortToHostPort(adminPort)\n\tflagSet.String(statusHTTPHostPort, adminPortStr, fmt.Sprintf(\n\t\t\"The host:port (e.g. 127.0.0.1%s or %s) for the health check\", adminPortStr, adminPortStr,\n\t))\n\treturn flagSet\n}\n\nfunc convert(httpHostPort string) string {","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/cmd/internal/status/command.go#L24-L60","documentation":"The `jaeger status` (doStatus) command issues an HTTP GET to the running Jaeger instance's admin endpoint and prints the response body. If the server responds with any status other than 200 OK, the command fails with this error carrying the received status code, signaling that the service is not healthy/ready.","triggerScenarios":"Running `jaeger status` against an instance whose admin health endpoint returns non-200 — service still starting (503 not ready), shutting down, or the request hit the wrong URL/port that returns e.g. 404.","commonSituations":"Executing the status command before Jaeger finished initialization; pointing the status command at the wrong admin port (default 14269); a reverse proxy intercepting the request; the Jaeger process crashed but something else answers on that port.","solutions":["Wait until the Jaeger service reports Ready (health check flips after RunAndThen sets it) and retry `jaeger status`","Verify the status command's admin port/URL matches jaeger.admin.http.host-port of the running instance (default :14269)","Check the printed response body — it shows what the endpoint actually returned (e.g. 503 with health details)","Confirm you are querying the right process: `curl http://localhost:14269/` to inspect the admin server directly"],"exampleFix":"// before\n# jaeger status -> 503\ncmd.Flags().String(\"status-http-host-port\", \":8080\", \"...\")  // wrong port\n// after\n# point at the admin port actually configured\njaeger status --admin-http-port 14269","handlingStrategy":"try-catch","validationCode":"// Before trusting `jaeger status`, probe the admin endpoint yourself\nresp, err := http.Get(fmt.Sprintf(\"http://%s/\", adminAddr))\nif err != nil {\n    return fmt.Errorf(\"admin endpoint unreachable at %s: %w\", adminAddr, err)\n}\nif resp.StatusCode != http.StatusOK {\n    return fmt.Errorf(\"service not healthy yet, status %d\", resp.StatusCode)\n}","typeGuard":null,"tryCatchPattern":"if err := statusCmd.RunE(cmd, args); err != nil {\n    if strings.HasPrefix(err.Error(), \"abnormal value of http status code\") {\n        // service not ready or wrong admin port; retry with backoff\n        time.Sleep(2 * time.Second)\n        return retry()\n    }\n    return err\n}","preventionTips":["Retry the status command with backoff right after service start (health flips to Ready only after initialization)","Point the status command at the real jaeger.admin.http.host-port (default :14269)","Read the response body the command prints — it explains the non-200","Verify no proxy intercepts the admin endpoint"],"tags":["http","health-check","cli"],"backgroundTag":"http-non-200-response","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}