saz / puppet-sudo

Manage sudo with Puppet on Debian-, RedHat- and SUSE-based linux distributions and some BSDs
Other
107 stars 215 forks source link

undefined method `optional_repeated_param' #168

Closed Kyrremann closed 7 years ago

Kyrremann commented 7 years ago

Using latest stdlib-4.13.1 and sudo-3.1.0 gives me the following error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, undefined method `optional_repeated_param' for #<Puppet::Functions::InternalDispatchBuilder:0x7f0549189318> at /usr/share/puppet/environments/test/modules/sudo/manifests/init.pp:95:3 on node agent.site.com
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:207:in `is_http_200?'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:100:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:201:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:289:in `retrieve_new_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:327:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:326:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:288:in `retrieve_new_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:61:in `retrieve_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:104:in `prepare_and_retrieve_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:201:in `run_internal'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:132:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/context.rb:64:in `override'
/usr/lib/ruby/site_ruby/1.8/puppet.rb:244:in `override'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:131:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:47:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:20:in `lock'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:47:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:117:in `with_client'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:44:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:82:in `run_in_fork'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:43:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:179:in `call'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:179:in `controlled_run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:41:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:356:in `onetime'
/usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:322:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:384:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:510:in `plugin_hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:384:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:488:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:384:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:146:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:92:in `execute'
/usr/bin/puppet:8

I've tried other combinations of the libraries, but always seems to end up with a error. I've just switched to the new directory layout with environments, and it was working fine with the old layout.

Similar error with sudo-3.0.9.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, undefined method `optional_repeated_param' for #<Puppet::Functions::InternalDispatchBuilder:0x7f0546f56430> at /usr/share/puppet/environments/test/modules/sudo/manifests/init.pp:94:3 on node agent.site.com
saz commented 7 years ago

Can you try it with the newest release, if this is still happening for you?

Kyrremann commented 7 years ago

Just tried with puppetlabs/stdlib-4.14.0 and saz/sudo-4.1.0, and got a slightly new error.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, undefined method `repeated_param' for #<Puppet::Functions::DispatcherBuilder:0x7ff94317b6e8> at /usr/share/puppet/modules/sudo/manifests/init.pp:106:3 on node agent.site.com

I tried to grep after the usage of repeated_param and can't find it in your code. So I'm thinking maybe it's just on my side. Or if it's because we're using Puppet 3.7.1. Maybe we need to switch to Puppet 4 or higher to get it to work.

PS: We're still using the environments-folders, but the modules have been moved outside.

Kyrremann commented 7 years ago

A quick update, as I'm testing some more. It seems like it's stdlib that causes the problem. I'm using latest sudo now, and testing each stdlib from 4.4.0 and up.

Kyrremann commented 7 years ago

Another update. I've tested some more, and it seems like it may be the order of updating the modules affect them. As I had sudo-4.1.0 running, and then tried stdlib-4.14.0 by an accident (as forge.puppet.com didn't update their download link when I switched versions), and now it seems like it's working.

I need to look more into it, but won't have time before later this week. I'll keep you updated.

saz commented 7 years ago

Any news on this? Anything I can help with?

Kyrremann commented 7 years ago

Managed to do a test now. It seems like it was the "order" of upgrade the plugins that created the error. This time I first upgraded stdlib-4.14.0 and the compiled the catalog, then I upgraded sudo-4.1.0 and compiled the same catalog again. And it all works good.

So my guess is that somehow when I upgraded them at the same time, the compiling didn't work in the correct order or something.

I think that we can close the issue.

saz commented 7 years ago

Thanks for the information.

Kyrremann commented 7 years ago

A quick update. I merged my code into our Master, and it broke on our production servers. And the reason wasn't the order of compiling, but the version of Puppet we're running. I had forgotten that we had updated Puppet in test, and not production.

We're running 3.8.7 in test, but only 3.7.1 in production.

saz commented 7 years ago

And it's failing on 3.8.7 or 3.7.1?

Kyrremann commented 7 years ago

It's failing on 3.7.1. Can understand that it wasn't that clear from my comment.

madAndroid commented 7 years ago

Updating to 3.8.7 fixed this for us as well