{"record":{"id":"4d4f57ac3441b12c","repo":"crowdsecurity/crowdsec","slug":"performing-jwt-auth-w","errorCode":null,"errorMessage":"performing jwt auth: %w","messagePattern":"performing jwt auth: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apiclient/auth_jwt.go","lineNumber":210,"sourceCode":"\tfor {\n\t\tif log.IsLevelEnabled(log.TraceLevel) {\n\t\t\t// requestToDump := cloneRequest(req)\n\t\t\tdump, _ := httputil.DumpRequest(req, true)\n\t\t\tlog.Tracef(\"req-jwt: %s\", string(dump))\n\t\t}\n\t\t// Make the HTTP request.\n\t\tclonedReq := cloneRequest(req)\n\n\t\tclonedReq, err := t.prepareRequest(clonedReq)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresp, err = t.transport().RoundTrip(clonedReq)\n\t\tif err != nil {\n\t\t\t// we had an error (network error for example), reset the token?\n\t\t\tt.ResetToken()\n\t\t\treturn resp, fmt.Errorf(\"performing jwt auth: %w\", err)\n\t\t}\n\n\t\tif resp != nil {\n\t\t\tlog.Debugf(\"resp-jwt: %d\", resp.StatusCode)\n\t\t}\n\n\t\tconfig, shouldRetry := t.RetryConfig.StatusCodeConfig[resp.StatusCode]\n\t\tif !shouldRetry {\n\t\t\tbreak\n\t\t}\n\n\t\tif attemptsCount[resp.StatusCode] >= config.MaxAttempts {\n\t\t\tlog.Infof(\"max attempts reached for status code %d\", resp.StatusCode)\n\t\t\tbreak\n\t\t}\n\n\t\tif config.InvalidateToken {\n\t\t\tlog.Debugf(\"invalidating token for status code %d\", resp.StatusCode)","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/apiclient/auth_jwt.go#L192-L228","documentation":"JWTTransport.RoundTrip executed the authenticated request after token preparation; a transport-level failure occurred (network error, timeout), so the token is reset (forcing re-auth) and the error is wrapped and returned.","triggerScenarios":"Thrown at pkg/apiclient/auth_jwt.go:210 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check connectivity to the LAPI","Inspect the wrapped transport error for root cause","Retry; token reset forces fresh authentication on next attempt"],"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"}