Issue #10963 has been updated by Rutger Spiertz.

Thomas Haggett wrote:
> Great. FYI this: #7428 seems to be the same ruby19 compatibility problem and 
> IMHO should be an equally trivial fix. (note my comment in there)

That bug has been fixed in 2.7.10 but this one still exists.

----------------------------------------
Bug #10963: Collected resources with a puppet master fail on Ruby 1.9.x
https://projects.puppetlabs.com/issues/10963#change-55349

Author: Thomas Haggett
Status: Accepted
Priority: Normal
Assignee: 
Category: ruby19
Target version: 2.7.x
Affected Puppet version: 2.7.6
Keywords: 
Branch: 


I've reproduced this with a simple user resource:

    @user { "fred":
      groups => [],
    }

which I'm then trying to realise on certain machines, adding the sysadmin group 
in if appropriate for the system / user, as such:

    User <| title == "fred" |> {
      group +> 'sysadmin'
    }


Running this with `puppet apply` works as expected, but as soon as you push 
this to a puppet master, the following is thrown:

    err: Puppet::Parser::Compiler failed with error ArgumentError: wrong number 
of arguments (1 for 0) on node <fqdn>

    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/collector.rb:36:in 
`block in evaluate'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/resource.rb:144:in 
`merge'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:45:in 
`add_override'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/collector.rb:51:in 
`block in evaluate'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/collector.rb:41:in 
`each'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/collector.rb:41:in 
`evaluate'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:248:in 
`block (2 levels) in evaluate_collections'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:247:in 
`each'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:247:in 
`block in evaluate_collections'
    /usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/util/errors.rb:35:in 
`exceptwrap'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:243:in 
`evaluate_collections'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:274:in 
`block in evaluate_generators'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:270:in 
`loop'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:270:in 
`evaluate_generators'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:105:in 
`compile'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/parser/compiler.rb:24:in 
`compile'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/catalog/compiler.rb:77:in
 `block in compile'
    /usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/util.rb:180:in `block 
in benchmark'
    /usr/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
    /usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/util.rb:179:in 
`benchmark'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/catalog/compiler.rb:75:in
 `compile'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/catalog/compiler.rb:35:in
 `find'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/indirector/indirection.rb:189:in
 `find'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/network/http/handler.rb:106:in
 `do_find'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/network/http/handler.rb:68:in
 `process'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/network/http/webrick/rest.rb:24:in
 `service'
    /usr/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
    /usr/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
    
/usr/lib/ruby/gems/1.9.1/gems/puppet-2.7.6/lib/puppet/network/http/webrick.rb:45:in
 `block (3 levels) in listen'
    /usr/lib/ruby/1.9.1/webrick/server.rb:183:in `call'
    /usr/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'


I'm not particularly up to speed with the puppet code-base but I had a quick 
poke around and it seems the exception is thrown on a meta-class method 
(is_child?) which is given a block with no arguments:

      
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/parser/collector.rb#L34

      overrides[:source].meta_def(:child_of?) do
        true
      end

Having a further poke around, it seems that the standard #child_of? is 
typically called with a single argument (klass) which would have been ignored 
on ruby 1.8. Not so with ruby 1.9.

I've patched this on my systems by tweaking the above lines on the puppet 
master to read:

      overrides[:source].meta_def(:child_of?) do |*_|
        true
      end

And my manifests all behave normally again.

I'd like to see this fixed in puppet master if at all possible (it seems like a 
trivial patch), but don't know the processes or requirements (as in tests / 
agreements, etc)..

I'm afraid I also haven't figured out which version of puppet introduced this 
error as I only came across it with 2.7.5 / 2.7.6 as I was trying to configure 
the above resources.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to