Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#145 Failsafe from rollbar-gem. ArgumentError: "invalid byte sequence in UTF-8" in /usr/local/rvm/gems/ruby-2.2.1/gems/rollbar-2.7.1/lib/rollbar/request_data_extractor.rb:197:in `=~': build_payload in exception_data #389

Closed
i-void opened this issue Feb 22, 2016 · 3 comments

Comments

@i-void
Copy link

i-void commented Feb 22, 2016

We are getting this error so much. Once every 20 minute. What is the reason of this error, how can we avoid this?

@jondeandres
Copy link
Contributor

@Codem4ster can you send us an email to support@rollbar.com and tell us your account name and project?

Do you have any chance to start a debugger before that line and inspect the variables there?

@i-void
Copy link
Author

i-void commented Feb 22, 2016

@jondeandres I found the problem. '=~' operator doesn't work on non UTF-8 encodings. We try sending data to rollbar which we get from an external service. This service sends us ISO-8859-9 encoded data. I solved my problem by force_encode('ISO-8859-9').encode('UTF-8').

If you want to solve this globally, you can reproduce the error by doing these;

  • create a file in text editor
  • write into it 'ŞşĞğİıÇçÜü' and save as ISO-8859-9 (Turkish) encoded
  • in a ruby script File.read() this file
  • try to use '=~' operator on taken string

If you can solve this, can you share with me? I would be very appreciate.

@jondeandres
Copy link
Contributor

@Codem4ster awesome, thank you very much for the details. We'll will work on a fix as soon as possible and we'll contact you, ok?

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants