Bug #1421

missing comma in selector causes host to barf

Added by martin krafft over 3 years ago. Updated almost 2 years ago.

Status:Rejected Start date:07/13/2008
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:language
Target version:0.24.6
Affected Puppet version:0.24.4 Branch:
Keywords:
Votes: 0

Description

I have this in my site.pp manifest (full file attached):

Package {
  provider => $operatingsystem ? {
    debian => aptitude,
  }
}

(note that there’s comma missing at the end of line 4.)

When a new host connects, it barfs (full debug,trace output attached):

err: Could not retrieve catalog: No matching value for selector param ‘’ at /etc/puppet/manifests/site.pp:8 on node pict.oerlikon.madduck.net

On second run, the problem is gone. I cannot reproduce the problem evern after cleaning out the clientbucket, state, and ssl/certs directory.

vit.YjT19959 - debug output (7.1 kB) martin krafft, 07/13/2008 06:45 pm

site.pp - site manifest (296 Bytes) martin krafft, 07/13/2008 06:45 pm

History

Updated by Jeff Goldschrafe over 3 years ago

I’m noticing the same exact problem in my deployment. It just started happening today and I have no idea what’s causing it.

Updated by James Turnbull over 3 years ago

  • Category set to language
  • Status changed from Unreviewed to Accepted

Updated by James Turnbull over 3 years ago

  • Target version set to 0.24.6

Updated by Luke Kanies over 3 years ago

This isn’t a syntax problem, it’s a logic problem. The comma you think you’re missing is optional.

The problem you’re having is that sometimes your selector has a value (when running on Debian) and sometimes it doesn’t. You need to either provide a default value, or (more likely) you should use a case statement:

case $operatingsystem {
  debian: {
    Package { provider => aptitude }
  }
}

Updated by Luke Kanies over 3 years ago

  • Status changed from Accepted to Rejected

Updated by martin krafft over 3 years ago

There was no non-Debian system involved. So there is a bug that at times, the $operatingsystem is not properly set.

Updated by Luke Kanies over 3 years ago

Then it’s probably the case-sensitivity issue mentioned in another bug, or an issue finding the host’s facts, as mentioned in that ticket.

Also available in: Atom PDF