Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to make my own function. I keep getting this message.

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Function 'brent_k' does not return a value at /etc/puppet/modules/munin/manifests/init.pp:17 on node

Here is my simple code cat brent_k.rb
  module Puppet::Parser::Functions
    newfunction(:brent_k, :type => :rvalue) do |args|
      val = 'ok'

And then in my manifest, I have

$a = brent_k()

I tried return val too. How can I fix this?

share|improve this question
You may wish to accept some previous questions to ensure you get a good response. – Alastair McCormack Oct 18 '12 at 12:18
K I found the answer. It appears puppet does some caching. So first I added 'ignorecache = true' to puppet.conf. But then I found that thats for the client caching. I then found that if I keep restarted puppetmaster, then I my dev env, I can see my changes / test. – Brent Oct 18 '12 at 13:41

2 Answers 2

When you change any custom ruby code, such as a custom function, you must restart the Puppetmaster. If you are running puppet under passenger, this means restarting Apache. Otherwise, you'll get the old version.

In addition, there is a rather nasty bug that kicks in if you are hosting multiple environments in your puppetmaster with an identically named function in the other environment. In this case, you have no way to be sure which environment's function is used when you call the function name! It uses the same function namespace across all environments... (this is confirmed to happen in Puppet 2.7.22, not sure about 3.x)

share|improve this answer

As the documentation says:

The puppet master caches custom functions. If you edit an existing function (e.g. while you’re developing it), you’ll need to restart the puppet master before the new version can be used.

Note about restarting Puppet master:

If you execute the following command to restart Puppet master:

$ service puppetmaster restart
Restarting puppet master
puppetmaster not configured to start, please edit /etc/default/puppetmaster to enable 

You will notice that the service stops but doesn't start.

In that case, as Steve Shipway mentioned, you are probably running Puppet master under Passenger and you need to reload apache2 to actually restart Puppet master:

$ service apache2 reload
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.