Bug #9290

Puppet master fails with 'stack level too deep' error when storeconfigs = true with rails stack 3.1.0

Added by Mark Stanislav 9 months ago. Updated 1 day ago.

Status:Accepted Start date:08/31/2011
Priority:High Due date:
Assignee:- % Done:

0%

Category:Rails
Target version:-
Affected Puppet version:2.7.3 Branch:
Keywords:storeconfigs rails activerecord 3.1.0
Votes: 10

Description

Out of nowhere, a known-working Puppet stack build script started to fail. The tell-tale error is ‘stack level too deep’ which from other historical bug reports always seems related to Ruby directly. After many hours of digging around, I checked for updated gem versions on the system. There was an update to rails 3.1.0 (and activerecord, etc.) which apparently is breaking the Puppet master when working with storeconfigs = true. Disabling storeconfigs immediately works as expected again.

When reverting from rails and friends 3.1.0 to 3.0.10, Puppet again works as expected.

I don’t have any insight into where exactly this is all failing, only the version which is causing the issue and the condition to emulate it.

This was only tested again Puppet 2.7.3 using the gem install with both webrick and Apache+Passenger.

Attached is a debug output.

error-trace (11.4 kB) Mark Stanislav, 08/31/2011 04:33 pm

master-trace.txt (284.9 kB) Markus Strauss, 03/04/2012 10:30 pm


Related issues

related to Puppet - Bug #9304: Problem with activerecord 3.1.0, puppet 2.6.2, and storec... Accepted 09/01/2011
related to Puppet - Bug #11883: Spec tests are failing when you have Rails 3.1.3 installed Accepted 01/10/2012

History

Updated by James Turnbull 9 months ago

  • Category set to Rails
  • Keywords changed from storeconfigs rails activerecord to storeconfigs rails activerecord 3.1.0

Updated by James Turnbull 9 months ago

  • Status changed from Unreviewed to Accepted
  • Priority changed from Normal to High

Updated by Carl Lantz 9 months ago

I am having the same error using the git repository as of today. Downgrading to activerecord 3.0.10 fixed the issue. It errored with both webrick and apache+passenger. The following was repeated several times with webrick:

/usr/lib/ruby/site_ruby/1.8/puppet/rails/resource.rb:177:in parameter' /usr/lib/ruby/site_ruby/1.8/puppet/rails/resource.rb:87:in[]‘ /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association_scope.rb:81:in add_constraints' /usr/lib/ruby/gems/1.8/gems/activemodel-3.1.0/lib/active_model/attribute_methods.rb:102:ineach_with_index’ /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association_scope.rb:55:in each' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association_scope.rb:55:ineach_with_index' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association_scope.rb:55:in add_constraints' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association_scope.rb:33:inscope' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association.rb:99:in association_scope' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/association.rb:88:inscoped' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/collection_proxy.rb:51:in __send__' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/collection_proxy.rb:51:inscoped' /usr/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/associations/collection_proxy.rb:102:in method_missing' /usr/lib/ruby/site_ruby/1.8/puppet/rails/resource.rb:177:inparameter' /usr/lib/ruby/site_ruby/1.8/puppet/rails/resource.rb:87:in `[]'

Updated by Tray Torrance 8 months ago

Confirmed for me – Puppet 2.7.3, Unicorn 4.1.1

Downgrading from activerecord 3.1.0 to 3.0.10 resolved it here, as well. Will try to test on 2.7.5 this weekend.

Updated by Jan Hebler 7 months ago

Same Error with 2.7.5

Updated by Joshua Hoblitt 7 months ago

Same error with 2.7.6

err: Could not retrieve catalog from remote server: Error 400 on SERVER: stack level too deep

Updated by Justin Honold 7 months ago

Also ran into this one, thx for the downgrade tip.

Updated by Keiran S 7 months ago

I hit this also, downgrading to activerecord 3.0.10 and its related dependencies resolved it for me.

K

Updated by Anchor Systems 5 months ago

Another “it’s broken” observation here — Puppet 2.7.6, infinite loop with ARec 3.1.1, works fine with 3.0.11. Might be worth at least putting a version constraint on ARec at load time, so people don’t get bitten, until the problem can be found and fixed properly.

Updated by Jordan Sissel 4 months ago

Confirmed still in ActiveRecord 3.2.0

Updated by Jonas Genannt 4 months ago

If you hvae more than one Rails version installed, you can force an older activerecord version to puppet:

gem ‘activerecord’, ‘=2.2.2’ require ‘activerecord’

Add this into your config.ru file.

Updated by Anthony Caiafa 4 months ago

looks like the same is happening with

puppet-server-2.7.1-1

activerecord (3.2.1)

Updated by Cody Robertson 3 months ago

I’m also experiencing this after upgrading to activerecord 3.2.1. I’ve found the newest branch that works is 3.0.x (3.0.11 as of this comment). The 3.1.x and 3.2.x seem to produce this error.

gem install activerecord -v 3.0.11

Updated by Daniel Pittman 3 months ago

If anyone experiencing this problem could test out the code in https://github.com/puppetlabs/puppet/pull/497 and see if it makes any difference, that would be awesome.

Updated by Markus Strauss 3 months ago

I have applied the patch for lib/puppet/rails/inventory_node.rb from pull req. 497, but still, same problem on my old Debian Lenny. See the attached trace.

Updated by Daniel Pittman 3 months ago

Well, it was a hope. Thanks for confirming this is still a problem.

Updated by Lluis Gili 1 day ago

the workaround proposed at note 11 made my rack crash, instead I’ve modified lib/puppet/feature/rails.rb:

 Puppet.features.add(:rails) do
   begin
+    # http://projects.puppetlabs.com/issues/9290
+    gem 'activerecord', '=3.0.6'
     require 'active_record'
     require 'active_record/version'

Also available in: Atom PDF