{"record":{"id":"465deb8412601f40","repo":"nats-io/nats-server","slug":"non-ok-http-status-on-get-request-reqlen-d-d","errorCode":null,"errorMessage":"non-ok http status on GET request (reqlen=%d): %d","messagePattern":"non-ok http status on GET request \\(reqlen=(.+?)\\): (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/ocsp.go","lineNumber":179,"sourceCode":"\topts := oc.srv.getOpts()\n\tvar overrideURLs []string\n\tif config := opts.OCSPConfig; config != nil {\n\t\toverrideURLs = config.OverrideURLs\n\t}\n\tgetRequestBytes := func(u string, reqDER []byte, hc *http.Client) ([]byte, error) {\n\t\treqEnc := base64.StdEncoding.EncodeToString(reqDER)\n\t\tu = fmt.Sprintf(\"%s/%s\", u, reqEnc)\n\t\tstart := time.Now()\n\t\tresp, err := hc.Get(u)\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=GET, 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 GET request (reqlen=%d): %d\", len(reqEnc), resp.StatusCode)\n\t\t}\n\t\treturn io.ReadAll(resp.Body)\n\t}\n\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","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/ocsp.go#L161-L197","documentation":"getRemoteStatus's GET helper: an OCSP responder returned an HTTP status above 299 for the base64-encoded GET request. The request length and status code are included; the loop over responders treats this as a failure of that server.","triggerScenarios":"Thrown at server/ocsp.go:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the OCSP responder URL's health and the certificate's AIA field","Allow the monitor to try the next responder or the POST method (built-in fallback)","Investigate responder-side rate limiting or auth requirements"],"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-08T10:18:20.063Z"}