{"record":{"id":"f7c908f3ab08b61f","repo":"crowdsecurity/crowdsec","slug":"retryable-status-d","errorCode":null,"errorMessage":"retryable status: %d","messagePattern":"retryable status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apiclient/auth_retry.go","lineNumber":69,"sourceCode":"\tattemptLeft := maxAttempts\n\n\toperation := func() (*http.Response, error) {\n\t\tclonedReq := cloneRequest(req)\n\n\t\tattemptLeft--\n\n\t\tresp, err := r.next.RoundTrip(clonedReq)\n\t\tif err != nil {\n\t\t\tif attemptLeft > 0 {\n\t\t\t\tlog.Errorf(\"while performing request: %s; %d retries left\", err, attemptLeft)\n\t\t\t}\n\n\t\t\treturn nil, fmt.Errorf(\"retryable error: %w\", err)\n\t\t}\n\n\t\tif r.shouldRetry(resp.StatusCode) {\n\t\t\tlog.Errorf(\"request returned status %d: %s; %d retries left\", resp.StatusCode, resp.Status, attemptLeft)\n\t\t\treturn nil, fmt.Errorf(\"retryable status: %d\", resp.StatusCode)\n\t\t}\n\n\t\treturn resp, nil\n\t}\n\n\tresp, err := backoff.Retry(req.Context(), operation,\n\t\tbackoff.WithBackOff(bo),\n\t\tbackoff.WithMaxTries(maxAttempts),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp, nil\n}\n","sourceCodeStart":51,"sourceCodeEnd":85,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/apiclient/auth_retry.go#L51-L85","documentation":"The retry transport converts a retryable HTTP status (429, 500, 503, 504) into this error and retries with backoff; it surfaces when all attempts returned such statuses. The status code is in the message.","triggerScenarios":"Thrown at pkg/apiclient/auth_retry.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check LAPI health/logs for the failing status (often 429 rate-limiting or 503 overload)","Reduce request rate or increase backoff","Retry after the server recovers"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}