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

Failed to deploy after 0.35.0 upgrade #1021

Closed
bzf opened this issue May 5, 2020 · 8 comments · Fixed by #1023
Closed

Failed to deploy after 0.35.0 upgrade #1021

bzf opened this issue May 5, 2020 · 8 comments · Fixed by #1023
Assignees
Labels
bug Involves a bug community Was opened by a community member core Involves Datadog core libraries
Projects
Milestone

Comments

@bzf
Copy link

bzf commented May 5, 2020

We upgraded to 0.35.0 and our deploy release step (bundle exec rails db:migrate) on Heroku failed with the following error message:

/app/vendor/bundle/ruby/2.6.0/gems/ddtrace-0.35.0/lib/ddtrace/configuration/components.rb:150:in `each': undefined method `close' for nil:NilClass (NoMethodError)
	from /app/vendor/bundle/ruby/2.6.0/gems/ddtrace-0.35.0/lib/ddtrace/configuration/components.rb:150:in `teardown!'
	from /app/vendor/bundle/ruby/2.6.0/gems/ddtrace-0.35.0/lib/ddtrace/configuration.rb:44:in `shutdown!'
	from /app/vendor/bundle/ruby/2.6.0/gems/ddtrace-0.35.0/lib/ddtrace.rb:37:in `block in <module:Datadog>'

Reverting to 0.34.2 makes the command succeed without any other changes.

We're running Rails 6.0.2.2 and Ruby 2.6.5 if that helps. If you need any more information just let me know and I'll try to respond as fast as I can 😄

@delner
Copy link
Contributor

delner commented May 5, 2020

I think this Array wasn't compacted as it should have been, leading to the error you're seeing.

@jonallured
Copy link

I think we have the same issue over on this one: artsy/convection#617. Feel free to use convection as a test case since it's open source! A good way to reproduce this is to run this one:

$ bundle exec rake environment

That'll load the Rails environment and get you a stacktrace:

Traceback (most recent call last):
        3: from /Users/jon/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/ddtrace-0.35.0/lib/ddtrace.rb:37:in `block in <module:Datadog>'
        2: from /Users/jon/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/ddtrace-0.35.0/lib/ddtrace/configuration.rb:44:in `shutdown!'
        1: from /Users/jon/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/ddtrace-0.35.0/lib/ddtrace/configuration/components.rb:150:in `teardown!'
/Users/jon/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/ddtrace-0.35.0/lib/ddtrace/configuration/components.rb:150:in `each': undefined method `close' for nil:NilClass (NoMethodError)

Hope that helps! ❤️

@delner
Copy link
Contributor

delner commented May 5, 2020

Opened a PR here: #1023

Could you try it out @bzf and confirm it fixes your issue?

@bzf
Copy link
Author

bzf commented May 5, 2020

@delner Yes, it worked when deploying with that branch! 👍

@delner
Copy link
Contributor

delner commented May 5, 2020

A good way to reproduce this is to run this one:

$ bundle exec rake environment

FWIW I did try your application and datadog.rb configuration with bundle exec rake environment but was unable to reproduce the bug.

Although I think we pinned the bug itself in that PR, it's unclear to me what in user configuration is causing the Statsd instance to be nil... we haven't been able to replicate this in any of our test environments or sample apps.

@delner
Copy link
Contributor

delner commented May 5, 2020

Okay cool, we'll get a bugfix shipped ASAP. Thanks for the report @bzf!

@marcotc
Copy link
Member

marcotc commented May 5, 2020

Thank you again for this report @bzf @jonallured!
We've just released 0.35.1, with the fix: #1023.

Given it's the same code as the branch you've tried @bzf, I don't think this issue will persist, but please let us know otherwise.

@bzf
Copy link
Author

bzf commented May 6, 2020

@marcotc I just updated the gem and deployed it, and it's working fine!
Thanks for the quick help solving this 😄 👍

@delner delner self-assigned this May 12, 2020
@delner delner added community Was opened by a community member core Involves Datadog core libraries labels May 12, 2020
@delner delner added this to Resolved/Closed in Active work Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member core Involves Datadog core libraries
Projects
Active work
  
Resolved/Closed
Development

Successfully merging a pull request may close this issue.

4 participants