Upgrade to version 2.7.1 breaks newrelic.
I followed the upgrade steps for 2.7.1, but new relic no longer works. It seems to be failing with a syntax error on both development and production.
Here’s part of the mongrel log on development:
---------------------------------------------------------------------------
** Starting Rails with development environment...
** [NewRelic] New Relic RPM Agent 2.7.1 Initialized: pid = 32042
** [NewRelic] Agent Log is found in /mnt/spangulu/projects/wedding/trunk/log/newrelic_agent.3004.log
** [NewRelic] Error initializing New Relic plugin (can't convert Array into String)
** [NewRelic] /mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:285:in `glob'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:285:in `instrument_app'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:440:in `start_reporting'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:178:in `start'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/config.rb:125:in `start_agent'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/config/rails.rb:25:in `start_plugin'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/init.rb:19:in `evaluate_init_rb'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin.rb:79:in `evaluate_init_rb'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin.rb:75:in `evaluate_init_rb'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin.rb:39:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:33:in `load_plugins'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:32:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:32:in `load_plugins'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:189:in `load_plugins'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:105:in `process'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `send'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `run'
/mnt/spangulu/projects/wedding/trunk/config/environment.rb:15
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:155:in `rails'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:112:in `cloaker_'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `call'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `listener'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:98:in `cloaker_'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `call'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
** [NewRelic] Agent is disabled.
---------------------------------------------------------------------------
We’re running ruby 1.8.5 – it worked fine before version 2.7.1 but no longer. If you look at the above, it is a bug in the Dir.glob usage in agent.rb:
The important code, in agent.rb:
instrumentation_path = File.join(File.dirname(__FILE__), 'instrumentation')
instrumentation_files = [ ] <<
File.join(instrumentation_path, '*.rb') <<
File.join(instrumentation_path, config.app.to_s, '*.rb')
Dir.glob(instrumentation_files) do |file|
begin
require file
log.debug "Processed instrumentation file '#{file.split('/').last}'"
rescue => e
log.error "Error loading instrumentation file '#{file}': #{e}"
log.debug e.backtrace.join("\n")
end
end
Dir.glob expects a string but is getting an array...
Here’s part of the mongrel log on development:
---------------------------------------------------------------------------
** Starting Rails with development environment...
** [NewRelic] New Relic RPM Agent 2.7.1 Initialized: pid = 32042
** [NewRelic] Agent Log is found in /mnt/spangulu/projects/wedding/trunk/log/newrelic_agent.3004.log
** [NewRelic] Error initializing New Relic plugin (can't convert Array into String)
** [NewRelic] /mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:285:in `glob'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:285:in `instrument_app'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:440:in `start_reporting'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/agent/agent.rb:178:in `start'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/config.rb:125:in `start_agent'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/lib/new_relic/config/rails.rb:25:in `start_plugin'
/mnt/spangulu/projects/wedding/trunk/vendor/plugins/newrelic_rpm/init.rb:19:in `evaluate_init_rb'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin.rb:79:in `evaluate_init_rb'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin.rb:75:in `evaluate_init_rb'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin.rb:39:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:33:in `load_plugins'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:32:in `each'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails/plugin/loader.rb:32:in `load_plugins'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:189:in `load_plugins'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:105:in `process'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `send'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `run'
/mnt/spangulu/projects/wedding/trunk/config/environment.rb:15
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:155:in `rails'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:112:in `cloaker_'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `call'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:138:in `listener'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:98:in `cloaker_'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `call'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:51:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:83:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
** [NewRelic] Agent is disabled.
---------------------------------------------------------------------------
We’re running ruby 1.8.5 – it worked fine before version 2.7.1 but no longer. If you look at the above, it is a bug in the Dir.glob usage in agent.rb:
The important code, in agent.rb:
instrumentation_path = File.join(File.dirname(__FILE__), 'instrumentation')
instrumentation_files = [ ] <<
File.join(instrumentation_path, '*.rb') <<
File.join(instrumentation_path, config.app.to_s, '*.rb')
Dir.glob(instrumentation_files) do |file|
begin
require file
log.debug "Processed instrumentation file '#{file.split('/').last}'"
rescue => e
log.error "Error loading instrumentation file '#{file}': #{e}"
log.debug e.backtrace.join("\n")
end
end
Dir.glob expects a string but is getting an array...
4
people have this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Great catch. The Dir.glob method changed in 1.8.6 to allow Strings or Array of Strings. Since we still support 1.8.5 we'll roll a patch for this right away.
Thanks,
Jim -
Inappropriate?This release had an incompatibility with Ruby 1.8.5.
This was fixed in version 2.7.3 of the agent. Please update your plugin.
The company says
this solves the problem
Loading Profile...



EMPLOYEE
EMPLOYEE