{"record":{"id":"4ea8f3c30d4d8090","repo":"glanceapp/glance","slug":"non-200-response-status-s","errorCode":null,"errorMessage":"non-200 response status: %s","messagePattern":"non-200 response status: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-docker-containers.go","lineNumber":332,"sourceCode":"\n\n\tfetchAll := ternary(runningOnly, \"false\", \"true\")\n\tctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)\n\tdefer cancel()\n\n\trequest, err := http.NewRequestWithContext(ctx, \"GET\", \"http://\"+hostname+\"/containers/json?all=\"+fetchAll, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating request: %w\", err)\n\t}\n\n\tresponse, err := client.Do(request)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"sending request to socket: %w\", err)\n\t}\n\tdefer response.Body.Close()\n\n\tif response.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"non-200 response status: %s\", response.Status)\n\t}\n\n\tvar containers []dockerContainerJsonResponse\n\tif err := json.NewDecoder(response.Body).Decode(&containers); err != nil {\n\t\treturn nil, fmt.Errorf(\"decoding response: %w\", err)\n\t}\n\n\tfor i := range containers {\n\t\tcontainer := &containers[i]\n\t\tname := strings.TrimLeft(itemAtIndexOrDefault(container.Names, 0, \"\"), \"/\")\n\n\t\tif name == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\toverrides, ok := labelOverrides[name]\n\t\tif !ok {\n\t\t\tcontinue","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-docker-containers.go#L314-L350","documentation":"The Docker API answered the /containers/json request with a status other than 200. The response status string is included. Typical codes: 500 (daemon error), 401/403 (TLS client-cert or auth proxy rejection), or a proxy error page (502) when something other than Docker listens on the target.","triggerScenarios":"Docker daemon internal error (500); TLS-secured endpoint expecting client certificates; pointing tcp:// at a reverse proxy or non-Docker service; API version mismatch on very old daemons.","commonSituations":"Source URL points at a port serving Traefik/nginx instead of the Docker API; Docker daemon over TLS requiring --tlscert; Docker in a crash-looping state.","solutions":["Reproduce manually: curl --unix-socket /var/run/docker.sock http://localhost/containers/json or curl http://host:2375/containers/json","If the endpoint is TLS-secured, use the correct scheme/port and ensure the daemon is configured to accept your client","Confirm the port actually serves the Docker API and not a web proxy","Check 'dockerd' logs for the underlying 500 cause"],"exampleFix":"# before\n  host: tcp://my-server:443\n# after (point directly at the Docker API port)\n  host: tcp://my-server:2375","handlingStrategy":"validation","validationCode":"req, _ := http.NewRequest(\"GET\", \"http://\"+hostname+\"/version\", nil)\nresp, err := client.Do(req)\nif err != nil || resp.StatusCode != 200 {\n    // endpoint is not a reachable Docker API; fix source before enabling widget\n}","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"non-200 response status\") {\n    slog.Error(\"docker API rejected request — check TLS/proxy on the source\", \"host\", hostname)\n}","preventionTips":["Point the source directly at the Docker API port (2375/2376), never at a web proxy port","For TLS endpoints, verify the daemon config and required client certs up front"],"tags":["docker","http-status","tls","proxy"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}