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

Deprecation warning with json gem 2.8.0+ #2462

Open
fschwahn opened this issue Nov 12, 2024 · 0 comments
Open

Deprecation warning with json gem 2.8.0+ #2462

fschwahn opened this issue Nov 12, 2024 · 0 comments
Assignees

Comments

@fschwahn
Copy link

Issue Description

The json-gem has introduced deprecation warnings in 2.8.0, see ruby/json#643. When using Sentry this leads to the following deprecation:

/app/vendor/bundle/ruby/3.3.0/gems/json-2.8.1/lib/json/common.rb:288: warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0 (RubyWarningHandler::Warning)

/app/vendor/bundle/ruby/3.3.0/gems/json-2.8.1/lib/json/common.rb:288:in `generate',
/app/vendor/bundle/ruby/3.3.0/gems/json-2.8.1/lib/json/common.rb:288:in `generate',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/envelope/item.rb:37:in `to_s',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/envelope/item.rb:41:in `serialize',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/transport.rb:74:in `block in serialize_envelope',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/transport.rb:73:in `each',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/transport.rb:73:in `serialize_envelope',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/transport.rb:61:in `send_envelope',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/transport.rb:51:in `send_event',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/client.rb:208:in `send_event',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/client.rb:271:in `block in dispatch_background_event',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-rails-5.21.0/lib/sentry/rails/background_worker.rb:6:in `_perform',
/app/vendor/bundle/ruby/3.3.0/gems/sentry-ruby-5.21.0/lib/sentry/background_worker.rb:56:in `block in perform',
/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in `run_task',
/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in `block (3 levels) in create_worker',
<internal:kernel>:187:in `loop',
/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in `block (2 levels) in create_worker',
/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `catch',
/app/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `block in create_worker'

Reproduction Steps

Use Sentry with json gem version 2.8.0+

Expected Behavior

Normal use should not produce deprecation warnings.

Actual Behavior

Deprecation warning printed

Ruby Version

3.3.6

SDK Version

5.21.0

Integration and Its Version

No response

Sentry Config

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants