airbrake / airbrake-ruby

A plain Ruby Airbrake notifier
https://airbrake.io
MIT License
79 stars 67 forks source link

Airbrake logging an unexpected 500 response from Airbrake API #696

Closed scottsbaldwin closed 2 years ago

scottsbaldwin commented 2 years ago

Hi Airbrake team! I have noticed that the airbrake gem (actually, airbrake-ruby) is logging a message in my application logs that it is receiving an HTTP 500 from the Airbrake API. My logs include only a truncated body so I can't give you more than this. I have seen two log messages related to the 500 errors:

E, [2022-08-17T14:02:09.374595 #7] ERROR -- : **Airbrake: unexpected code (500). Body: <html>
  <!--<![endif]-->
  <head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible"...

and

E, [2022-08-17T10:51:53.197554 #7] ERROR -- : **Airbrake: unexpected code (500). Body: {"code":500,"type":"Internal Server Error","message":"An error occurred while processing your request...

It appears that this message is written by https://github.com/airbrake/airbrake-ruby/blob/dfd766fc688c55741e3e8b98fa5ac7ba1fbc4c48/lib/airbrake-ruby/response.rb#L47. I am seeing these log messages every 30-60 seconds.

Penthious commented 2 years ago

Looking into this, thank you

shiva-gautam commented 2 years ago

We too are facing the same issue with truncated body message in our application logs. [Airbrake] [3]: unexpected code (500). Body: <html>#012 <!--<![endif]-->#012 <head>#012 <meta charset="utf-8"/>#012 <meta http-equiv="X-UA-Compatible"...

williantenfen commented 2 years ago

same here!

lessarderic commented 2 years ago

@Penthious, any ETA on a fix? This is causing us some problems in production right now and limiting our ability to use Airbrake.

Penthious commented 2 years ago

@Penthious, any ETA on a fix? This is causing us some problems in production right now and limiting our ability to use Airbrake.

Our team is currently looking into this error, when the issue is resolved on our end I'll make sure to ping you.

EvNomad commented 2 years ago

Waiting for the fix as well. Thanks!

rodrizapico commented 2 years ago

Just to add to this, since we're also running into this issue, we're seeing the following error logs in addition to the ones already reported:

[0;35m2022-08-24 13:12:13.755[0m [31mERROR[0m **Airbrake: HTTP error: end of file reached

And

[0;35m2022-08-24 13:15:17.414[0m [31mERROR[0m **Airbrake: HTTP error: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A

This is happening both in a Ruby 2.3 instance running and old version of the notifier, and a Ruby 2.7 instance running the latest version (6.1.1).

mmcdaris commented 2 years ago

Thanks for sharing the error details! The Airbrake team is still investigating these intermittent error responses when reporting to the service.

arfelio commented 2 years ago

We also have this issue, may be you could increase TRUNCATE_LIMIT here https://github.com/airbrake/airbrake-ruby/blob/dfd766fc688c55741e3e8b98fa5ac7ba1fbc4c48/lib/airbrake-ruby/response.rb#L9 and response will be more informative. We could provide this response for you and it helps to figure out the reason of bug.

mmcdaris commented 2 years ago

Thank you all for your patience on this one 🙏❤️ We believe our latest fix was successful, can you please confirm on your side?

arfelio commented 2 years ago

Thank you all for your patience on this one 🙏❤️ We believe our latest fix was successful, can you please confirm on your side?

Hi do you mean version 6.1.2 ?

kyrylo commented 2 years ago

@arfelio 6.1.2 won't fix the problem. The issue is not with airbrake-ruby, as it's not a library bug. We've been keeping this issue open so that others can communicate with us in one place, but strictly speaking, this ticket shouldn't exist in this repo.

As @mmcdaris mentioned, we've made some internal tweaks that should resolve the problem.

arfelio commented 2 years ago

@kyrylo i updated to the last versions of airbrake and airbrake-ruby yesterday, and today i hadn't such errors all day. Seems it works fine. Thank you

scottsbaldwin commented 2 years ago

@kyrylo, @mmcdaris, @Penthious thanks for the fixes!!! ❤️