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

wrong argument type nil (expected String) #266

Closed
belongstorachel opened this issue Jun 15, 2023 · 1 comment
Closed

wrong argument type nil (expected String) #266

belongstorachel opened this issue Jun 15, 2023 · 1 comment

Comments

@belongstorachel
Copy link

belongstorachel commented Jun 15, 2023

We recently upgraded our Ruby version of our application to 3.1.2. We are currently using Rails 6.0.

It seems that since our Ruby upgrade, the ruby-analytics gem throws "[analytics-ruby] wrong argument type nil (expected String)" We recently increased the amount of track & identify calls we are making to Segment and the instances of these errors are growing.

We are calling if Analytics.queued_messages >= 9_000

This is the stack trace that we have. (Note that the last line is what we have in the on_error: Proc.new { |status, msg| puts "Segment Error: #{status}, #{msg}" })

14:48:30.844
[analytics-ruby] wrong argument type nil (expected String)

14:48:30.844
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/activesupport-6.0.6.1/lib/active_support/core_ext/object/json.rb:39:in `to_json'

14:48:30.845
[analytics-ruby] /app/vendor/ruby-3.1.2/lib/ruby/3.1.0/forwardable.rb:238:in `to_json'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:110:in `generate'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:110:in `send_request'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:42:in `block in send'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:92:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:92:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:102:in `retry_with_backoff'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/transport.rb:41:in `send'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/worker.rb:45:in `run'

14:48:30.845
[analytics-ruby] /app/vendor/bundle/ruby/3.1.0/gems/analytics-ruby-2.4.0/lib/segment/analytics/client.rb:191:in `block (2 levels) in ensure_worker_running'

14:48:30.845
Segment Error: -1, wrong argument type nil (expected String)
@belongstorachel
Copy link
Author

belongstorachel commented Jun 21, 2023

We found the source of this issue. It has to do with a newer version of the oj gem. We were previously at 3.10.14, and upgraded to 3.14.3 which caused this error. When we reverted it back to 3.10.14, it stopped generating this error.

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