You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flusher fails to log: AttributeError: 'Response' object has no attribute 'exception' #25
ifresponse.status_code==500andgetattr(response, "exception") !=None:
print('Failed to send logs to Better Stack after {} retries: {}'.format(len(RETRY_SCHEDULE), response.exception))
Closing the loop on this one, sorry for the wait. The cause was in the flush worker's retry loop: after the last retry it read response.exception, which only exists on the stand-in object we create for connection errors. A genuine HTTP 500 from the server comes back as a real requests.Response, so the lookup raised AttributeError and killed the flush thread. The thread restarts on the next log record, which is why it only showed up occasionally and the traceback was the whole symptom.
Fixed in 0.4.1 by #41, thanks to @jaideeppyne for the patch and the regression test with a real Response. If you are still on 0.3.x, upgrading should resolve it.
Activity
curusarn commentedon Jun 13, 2024
Hey @nsbradford,
Thank you for raising this!
I'm passing this on to the team to reproduce and fix this.
Could you share steps on how to reproduce the issue? 🙏
It would help us fix this faster.
Thank you for the report!
nsbradford commentedon Jul 12, 2024
can't reliably reproduce, just happens occasionally 😅
PetrHeinz commentedon Sep 25, 2026
Closing the loop on this one, sorry for the wait. The cause was in the flush worker's retry loop: after the last retry it read response.exception, which only exists on the stand-in object we create for connection errors. A genuine HTTP 500 from the server comes back as a real requests.Response, so the lookup raised AttributeError and killed the flush thread. The thread restarts on the next log record, which is why it only showed up occasionally and the traceback was the whole symptom.
Fixed in 0.4.1 by #41, thanks to @jaideeppyne for the patch and the regression test with a real Response. If you are still on 0.3.x, upgrading should resolve it.