-
Notifications
You must be signed in to change notification settings - Fork 381
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
Undefined method `span_id' for nil:NilClass with long requests #445
Comments
@jvalanen Thanks for the report! If I'm interpreting the issue correctly, it looks like the trace isn't being started, thus when it tries to get the In the past, this sort of thing has happened when another gem conflicts with our Rails injection. I see that you have This might not be an explanation for the issue you're seeing, so any other configuration, Does this issue affect all of your controllers/routes? If not, is the length the only factor? (Is there some number which definitively separates the successes from the failures?) Are there other routes that generate shorter renders that suffer the same issue? Can you tell me more about the routes affected, and what are they doing? Are they making many DB calls per render? (Multiplied by however many partials there are?) Unless you're hitting some kind of hard limit on the number of spans in your trace (which I don't think is happening), I suspect this might have more to do with Rails being improperly patched than an issue of scale. But I'd be happy to dig in and find out if you can provide me with a little more info! |
Also possibly related #302 which was released in 0.11.0. |
I setup a Rails 5.1.4 application using ddtrace index.html.erb:
_line.html.erb: Line <%= index %> This had no problems at 1000, or 10,000 lines. It started to struggle at 100,000 lines, where it produced the following:
So if you have a trace that's producing over 100K spans, it's conceivable you might run into issues. That said, this still didn't produce an exception like your issue details, so it's not clear how that happened. |
You also mentioned that things were better on 0.11.4 vs 0.12.0. Looking at the diff between the tags, there were no changes to our render partial tracing, so this might be a side effect of some other kind of change. Would it be possible to activate debug mode, and share any debug messages you might receive? You can do so by adding the following to your configuration: Datadog.configure do |c|
c.tracer debug: true
end Any logs you could share would help greatly! |
Hey @delner, thanks for the super quick response and inspecting this issue! I didn't have time to dive into this yesterday but as my colleague @onnimonni had already tested, it seems to fix our that specific issue! Good job! I didn't follow completely how you traced this down but it makes sense that we hit some hard limit in rendering and it crashed because of that. I suppose this was enough to fix this particular issue. Or would it be beneficial for you if I could deliver some specific logs about this issue? Thanks so much! |
@jvalanen Glad to hear it works for you! Logs would be helpful, if you can provide them. Somehow it seemed something was off with your trace context, but I wasn't able to explain why despite looking quite deeply into it. That PR instead simply sidestepped the issue, by refactoring the code which avoids the direct consequences of that. This will probably roll with our 0.12.1 release currently scheduled for June 12th. Thanks for your report! Will close this issue when the fix is merged. |
In our application we have very complicated and long listings with tons of html elements. It can take even 300+ seconds for the view to render.
Shorter listings render fine but for those longer ones we receive
status=500 error='ActionView::Template::Error: undefined method 'span_id' for nil:NilClass'
:This error happens with ddtrace versions
>= 0.12.0
, downgrading to0.11.4
helped for us.Response:
View template looks about like this: (entries array may include 2000+ items...)
And inside items partial again:
Full trace:
The text was updated successfully, but these errors were encountered: