crowdsecurity/crowdsec · error

retryable error: %w

Error message

retryable error: %w

What it means

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.

Source

Thrown at pkg/apiclient/auth_retry.go:64

	} else {
		// backoff is disabled, policy of "no wait"
		bo = backoff.NewConstantBackOff(0)
	}

	attemptLeft := maxAttempts

	operation := func() (*http.Response, error) {
		clonedReq := cloneRequest(req)

		attemptLeft--

		resp, err := r.next.RoundTrip(clonedReq)
		if err != nil {
			if attemptLeft > 0 {
				log.Errorf("while performing request: %s; %d retries left", err, attemptLeft)
			}

			return nil, fmt.Errorf("retryable error: %w", err)
		}

		if r.shouldRetry(resp.StatusCode) {
			log.Errorf("request returned status %d: %s; %d retries left", resp.StatusCode, resp.Status, attemptLeft)
			return nil, fmt.Errorf("retryable status: %d", resp.StatusCode)
		}

		return resp, nil
	}

	resp, err := backoff.Retry(req.Context(), operation,
		backoff.WithBackOff(bo),
		backoff.WithMaxTries(maxAttempts),
	)
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to 909b515798)

Solutions

  1. Check network connectivity and LAPI availability
  2. Increase retry/backoff settings if the network is flaky
  3. Inspect the wrapped error for the underlying cause
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at pkg/apiclient/auth_retry.go:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06). Data as JSON: /api/errors/bda43b19e2c118d4. Report an issue: GitHub.