{"record":{"id":"bda43b19e2c118d4","repo":"crowdsecurity/crowdsec","slug":"retryable-error-w","errorCode":null,"errorMessage":"retryable error: %w","messagePattern":"retryable error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apiclient/auth_retry.go","lineNumber":64,"sourceCode":"\t} else {\n\t\t// backoff is disabled, policy of \"no wait\"\n\t\tbo = backoff.NewConstantBackOff(0)\n\t}\n\n\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","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/apiclient/auth_retry.go#L46-L82","documentation":"The retry transport wraps a network-level RoundTrip error as 'retryable error' and retries with backoff until maxAttempts is exhausted. The returned error indicates all attempts failed at the transport level.","triggerScenarios":"Thrown at pkg/apiclient/auth_retry.go:64 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check network connectivity and LAPI availability","Increase retry/backoff settings if the network is flaky","Inspect the wrapped error for the underlying cause"],"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-14T05:17:10.506Z"}