{"record":{"id":"a2edc7677a318a3c","repo":"nats-io/nats-server","slug":"non-ok-http-status-on-post-request-reqlen-d-d","errorCode":null,"errorMessage":"non-ok http status on POST request (reqlen=%d): %d","messagePattern":"non-ok http status on POST request \\(reqlen=(.+?)\\): (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/ocsp.go","lineNumber":201,"sourceCode":"\tpostRequestBytes := func(u string, body []byte, hc *http.Client) ([]byte, error) {\n\t\threq, err := http.NewRequest(\"POST\", u, bytes.NewReader(body))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\threq.Header.Add(\"Content-Type\", \"application/ocsp-request\")\n\t\threq.Header.Add(\"Accept\", \"application/ocsp-response\")\n\n\t\tstart := time.Now()\n\t\tresp, err := hc.Do(hreq)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\toc.srv.Debugf(\"Received OCSP response (method=POST, status=%v, url=%s, duration=%.3fs)\",\n\t\t\tresp.StatusCode, u, time.Since(start).Seconds())\n\t\tif resp.StatusCode > 299 {\n\t\t\treturn nil, fmt.Errorf(\"non-ok http status on POST request (reqlen=%d): %d\", len(body), resp.StatusCode)\n\t\t}\n\t\treturn io.ReadAll(resp.Body)\n\t}\n\n\t// Request documentation:\n\t// https://tools.ietf.org/html/rfc6960#appendix-A.1\n\n\treqDER, err := ocsp.CreateRequest(oc.Leaf, oc.Issuer, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tresponders := oc.Leaf.OCSPServer\n\tif len(overrideURLs) > 0 {\n\t\tresponders = overrideURLs\n\t}\n\tif len(responders) == 0 {\n\t\treturn nil, nil, fmt.Errorf(\"no available ocsp servers\")","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/ocsp.go#L183-L219","documentation":"getRemoteStatus's POST helper: the OCSP responder replied with an HTTP status above 299 to the application/ocsp-request POST. Includes body length and status code; the monitor then falls back to GET or the next responder URL.","triggerScenarios":"Thrown at server/ocsp.go:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify responder reachability and that it accepts OCSP POST requests","Rely on the built-in GET fallback and remaining responder URLs","Check network egress/firewall rules from the server"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}