-
Notifications
You must be signed in to change notification settings - Fork 378
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
1.2.0 Profiler regression: "Unable to report profile. Cause: wrong argument type nil (expected String)" #2151
Comments
@seuros in 1.2.0 I've added a fallback in case there was an issue with the new transport codepath (which unfortunately there is).
I suspect this issue may be due to application-wide tags that are set to |
A customer reported having their profiles fail with the following issue: > Unable to report profile. Cause: wrong argument type nil (expected String) Location: /var/cache/bundle/ruby/3.0.0/gems/ddtrace-1.2.0/lib/datadog/profiling/http_transport.rb:115:in _native_do_export' Unfortunately there's a bunch of data passed in to that function so just from that information it's not possible to be 100% sure which one was `nil`, but while doing a second pass at the code I noticed one way to trigger this would be to have tags that are `nil`. Thus here's a quick fix to ensure that the tags passed on to profiling are always strings. Issue #2151
|
Interesting; so that does not seem to be the source of the issue. I'll cook up a PR to improve the error messages in this case so we can debug this.
|
…_Type` While investigating #2151, I realized that `Check_Type`'s error message: `TypeError: wrong argument type nil (expected String)` is very hard to debug in functions that do many `Check_Type` verifications (such as `_native_do_export`). To fix this, I've created a new `ENFORCE_TYPE` helper which behaves similarly, but generates error messages such as: ``` TypeError: wrong argument nil for 'pprof_file_name' (expected a RUBY_T_STRING) at ../../../../ext/ddtrace_profiling_native_extension/http_transport.c:280:in `_native_do_export' ``` Hopefully this message will help us get to the bottom of the issue. I've modified every other use of `Check_Type` in the profiling native extension to use this new helper, in case we need to debug similar issues in the future. Issue #2151
I'm still not quite sure where the If you're open to it, you can test that PR directly by downloading the gemfile from here (you can install it with source 'https://s3.amazonaws.com/gems.datadoghq.com/prerelease-v2' do
gem 'ddtrace', '= 1.2.0.ivoanjo.prof.5808.improve.error.messages.246966'
end |
@ivoanjo, @nathaliagiusti and I ran into a similar issue on
In our case, our configuration included these tags: Datadog.configuration.tags
#=> { my_tag: false } We tested with your All that said, after taking a look at #2152, we changed our tag to a Datadog.configuration.tags
#=> { my_tag: 'false' } And we no longer experienced the |
That true, the tags hash need to have a string in all it value. I had a version as float. |
Thanks @Thomascountz and @seuros for the feedback! Indeed as part of #2152 we now call I'm going to go ahead and close this ticket as fixed by #2152. A new release of dd-trace-rb that includes that fix should be out within the next hours/days :) |
Originally posted by @seuros in #2067 (comment)
Looks like in some situations, a value that was assumed to always be a
String
is coming in asnil
. I'm investigating where thatnil
may be coming from.The text was updated successfully, but these errors were encountered: