Closed deric closed 11 years ago
This seems to be a problem with the reject funtion of the stdlib module:
# puppet --version
3.3.0
# puppet apply -e "notice reject(['a','b'],'b')"
Error: reject(): wrong argument type (String; must be a parameterized block. at line 1 on node foo
Wrapped exception:
reject(): wrong argument type (String; must be a parameterized block.
Error: reject(): wrong argument type (String; must be a parameterized block. at line 1 on node foo
So this should be reported at https://github.com/puppetlabs/puppetlabs-stdlib
Btw: it looks like you don't use pupptlabs' stdlib module, so instead of the function in this module, it uses the new (since 3.2) integrated function reject
of the future parser. However, this does not work together with this module.
I have puppetlabs/stdlib
4.1.0. The dependency should be specified in Modulefile, something like this:
dependency 'puppetlabs/stdlib', '>= 3.2.0 < 4.0.0'
4.1.0 should work as I'm using it and the correct reject function is part of 4.1.0. It looks like your modulepath is not correct and hence the built-in reject function gets loaded.
If you run puppet with --trace
you will see that this error comes from the new built-in reject function. That is used by the future parser:
http://projects.puppetlabs.com/issues/22729
However, if you use the stdlib the reject function of stdlib should be used and this one works.
Or do you have the future parser enabled?
I haven't heard of the future parser yet. How can I check if it is enabled?
This is stacktrace of the first exception occurrence:
Error: reject(): wrong argument type (String; must be a parameterized block. at line 1
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/functions/reject.rb:34:in `real_function_reject'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/functions.rb:147:in `send'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/functions.rb:147:in `function_reject'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/util/profiler/none.rb:6:in `profile'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/util/profiler.rb:26:in `profile'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/functions.rb:140:in `function_reject'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast/function.rb:42:in `send'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast/function.rb:42:in `evaluate'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast.rb:62:in `safeevaluate'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast/astarray.rb:25:in `evaluate'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast/astarray.rb:20:in `each'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast/astarray.rb:20:in `evaluate'
/var/lib/gems/1.8/gems/puppet-3.3.0/lib/puppet/parser/ast.rb:62:in `safeevaluate'
``
Well, if you haven't done anything special then it won't be enabled. It would be a config option.
So you are clearly loading the built-in function, that only works with the future parser, but this module won't support the future parser.
I still think your stdlib module is not loaded properly, can you provide output from:
puppet master --genconfig | gre modulepath
I assume you are using it an agent/master setup.
I'm using puppet-librarian for managing modules. The module path is default:
modulepath = /etc/puppet/modules
Yeah, it's agent/master setup.
And there is a stlib in /etc/puppet/modules/stdlib ?
But as I said, this is rather a puppet issue and you might get better support e.g. on the puppet-users list
Yes, the module is there:
$ cat /etc/puppet/modules/stdlib/Modulefile
name 'puppetlabs-stdlib'
version '4.1.0'
source 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
...
ok, we'll see if they resolve the bug