Skip to content


newrelic – undefined method `-‘ for nil:NilClass

Using JRuby with trinidad (developer mode) – I was intermittently getting this error. Apparently thrown as estimated_time for the transaction was returning nil. I was also having all sorts of other issues (undefined method `metric_name’ for nil:NilClass) with all newrelics action summaries.

To resolve (following suggestions on the trinidad google group):

According to Nick Sieger’s gist – “NewRelic isn’t detecting Trinidad at the moment” – Although I could see trinidad’s detection mechanism implemented in newrelic’s most recent (3.5.0.1)

I’ve tried it with more recent versions of newrelic – but it seems 3.3.0 is the most stable.

JRuby 1.6.8 (1.9 mode)

trinidad 1.4.4

newrelic_rpm 3.3.0

UPDATE:

Getting another error of undefined method `first' for true:TrueClass. The error is apparently thrown if the “EXPLAIN” query has failed against the DB engine. Although – I got the transaction_tracing disabled with explain_enabled set to false – yet this release still attempts to fire the “EXPLAIN” against the DB.


Since I’m using the oracle_enhanced_adapter, the current newrelic “EXPLAIN” query wouldn’t work – hence an error is thrown. However, the error consumption by newrelic returns true rather than nil.

Changing handle_exception_in_explain to return nil instead of the true fixes it.

Posted in Java, Ruby, Web.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.