{"action":"created","issue":{"url":"https://api.github.com/repos/getsentry/raven-ruby/issues/689","repository_url":"https://api.github.com/repos/getsentry/raven-ruby","labels_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/689/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/689/comments","events_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/689/events","html_url":"https://github.com/getsentry/raven-ruby/issues/689","id":233270258,"number":689,"title":"Encoding::UndefinedConversionError while tracking something that contains Unicode characters","user":{"login":"avel","id":198935,"avatar_url":"https://avatars2.githubusercontent.com/u/198935?v=4","gravatar_id":"","url":"https://api.github.com/users/avel","html_url":"https://github.com/avel","followers_url":"https://api.github.com/users/avel/followers","following_url":"https://api.github.com/users/avel/following{/other_user}","gists_url":"https://api.github.com/users/avel/gists{/gist_id}","starred_url":"https://api.github.com/users/avel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avel/subscriptions","organizations_url":"https://api.github.com/users/avel/orgs","repos_url":"https://api.github.com/users/avel/repos","events_url":"https://api.github.com/users/avel/events{/privacy}","received_events_url":"https://api.github.com/users/avel/received_events","type":"User","site_admin":false},"labels":[{"id":2713101,"url":"https://api.github.com/repos/getsentry/raven-ruby/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-06-02T18:57:14Z","updated_at":"2017-08-01T13:15:19Z","closed_at":"2017-06-14T20:32:02Z","body":"While tracking, either with capture_exception() or capture_message(), works fine generally, there were times where it would fail to report an error.\r\n\r\nHere are the errors and the relevant backtrace:\r\n\r\n**Encoding::UndefinedConversionError in** (method name...)\r\n\r\n**\"\\xE2\" from ASCII-8BIT to UTF-8**\r\n\r\n```\r\nApplication Trace\r\napp/controllers/application_controller.rb:64:in `respond_with_server_error'\r\napp/controllers/application_controller.rb:31:in `block in <class:ApplicationController>'\r\n\r\n\r\nFramework Trace\r\njson (1.7.7) lib/json/common.rb:254:in `encode'\r\njson (1.7.7) lib/json/common.rb:254:in `generate'\r\njson (1.7.7) lib/json/common.rb:254:in `fast_generate'\r\nsentry-raven (2.5.1) lib/raven/client.rb:67:in `encode'\r\nsentry-raven (2.5.1) lib/raven/client.rb:37:in `send_event'\r\nsentry-raven (2.5.1) lib/raven/instance.rb:81:in `send_event'\r\nsentry-raven (2.5.1) lib/raven/instance.rb:126:in `capture_type'\r\nactivesupport (4.2.4) lib/active_support/rescuable.rb:114:in `instance_exec'\r\nactivesupport (4.2.4) lib/active_support/rescuable.rb:114:in `block in handler_for_rescue'\r\nactivesupport (4.2.4) lib/active_support/rescuable.rb:80:in `call'\r\nactivesupport (4.2.4) lib/active_support/rescuable.rb:80:in `rescue_with_handler'\r\n....\r\n```\r\n\r\nNow, this seemed to happen only when the payload contained some funky characters, perhaps 4-byte unicode characters (emojis).\r\n\r\nAs you can see above it was triggered with json (1.7.7) gem, but I upgraded to latest json gem and it still happened.\r\n\r\nYou can probably reproduce this by including some emojis such as  ▷▷  ⬧  ✈ in the messgae.\r\n\r\nAlso, FYI I reverted to the earlier version raven-ruby 2.4.0 and this fixed the problem. It did happen with gem versions 2.5.0 and 2.5.1.\r\n\r\nIf you cannot reproduce this, it might be that my ruby version is to blame ― granted it's a bit old: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]  In that case let me know so that I can do more tests with newer ruby versions.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/getsentry/raven-ruby/issues/comments/319366434","html_url":"https://github.com/getsentry/raven-ruby/issues/689#issuecomment-319366434","issue_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/689","id":319366434,"user":{"login":"nateberkopec","id":845662,"avatar_url":"https://avatars0.githubusercontent.com/u/845662?v=4","gravatar_id":"","url":"https://api.github.com/users/nateberkopec","html_url":"https://github.com/nateberkopec","followers_url":"https://api.github.com/users/nateberkopec/followers","following_url":"https://api.github.com/users/nateberkopec/following{/other_user}","gists_url":"https://api.github.com/users/nateberkopec/gists{/gist_id}","starred_url":"https://api.github.com/users/nateberkopec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateberkopec/subscriptions","organizations_url":"https://api.github.com/users/nateberkopec/orgs","repos_url":"https://api.github.com/users/nateberkopec/repos","events_url":"https://api.github.com/users/nateberkopec/events{/privacy}","received_events_url":"https://api.github.com/users/nateberkopec/received_events","type":"User","site_admin":false},"created_at":"2017-08-01T13:15:19Z","updated_at":"2017-08-01T13:15:19Z","body":"@doitian please open another issue with more information. What encoding exactly, a stacktrace, etc."}}
{"actor":{"display_login":"nateberkopec"}}