The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Feature #7076

Error message isn't very clear about where problem is

Added by micah - about 5 years ago. Updated about 3 years ago.

Status:DuplicateStart date:04/12/2011
Priority:NormalDue date:
Assignee:-% Done:


Category:error reporting
Target version:-
Affected Puppet version: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


I received this error:

err: Could not run Puppet configuration client: Parameter ensure failed: Invalid value "ensure". Valid values are present, absent.  at line 31

indisputably, a bug in my manifests, but where? Fortunately, I was able to find it, but most puppet messages like this give you a clue where you failed so you have a much easier time of finding it.

Related issues

Duplicates Puppet - Bug #16208: parameter validation errors aren't very clear Closed 08/31/2012


#1 Updated by Ben Hughes about 5 years ago

  • Status changed from Unreviewed to Needs More Information

What was at line 31 and where was the actual bug please?

#2 Updated by micah - about 5 years ago

this was a module in which I had a selector which if true set ‘ensure’ to be whatever the $ensure variable was set to. I had left off the $ in front of the variable name ‘$ensure’ so I ended up setting ‘ensure => ensure’. The fix is as below:

diff --git a/manifests/service/imap.pp b/manifests/service/imap.pp
index 063231d..b703db4 100644
--- a/manifests/service/imap.pp
+++ b/manifests/service/imap.pp
@@ -16,7 +16,7 @@ define nagios::service::imap(
       ensure => $ensure;
       ensure => $tls ? {
-        true => ensure,
+        true => $ensure,
         default => 'absent'

#3 Updated by Ben Hughes about 5 years ago

  • Status changed from Needs More Information to Accepted

So, this is built up by lib/puppet/parameter/value_collection.rb:

  # Verify that the passed value is valid.
  def validate(value)
    return if empty?

    unless @values.detect { |name, v| v.match?(value) }
      str = "Invalid value #{value.inspect}. "

      str += "Valid values are #{values.join(", ")}. " unless values.empty?

      str += "Valid values match #{regexes.join(", ")}." unless regexes.empty?

      raise ArgumentError, str

Which is called from lib/puppet/type.rb’s

    property = self.newattr(name)

    if property
        # make sure the parameter doesn't have any errors
        property.value = value
      rescue => detail
        error ="Parameter #{name} failed: #{detail}")
        raise error

But I’m not sure if either of those two functions have the calling type or access to it’s name to report on. Pointing it at some devs to hopefully get some more light on if this is possible.

#4 Updated by Dominic Cleal about 3 years ago

  • Status changed from Accepted to Duplicate

Fixed now in #16208.

Also available in: Atom PDF