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:

Bug #5226

Ambiguous "Cannot find definition Class at..."

Added by Dan Trainor about 5 years ago. Updated about 3 years ago.

Status:AcceptedStart date:11/08/2010
Priority:LowDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version:2.6.2 Branch:
Keywords:Cannot find definition Class

We've Moved!

Ticket tracking is now hosted in JIRA:


Hi –

Given a sniplet of code inside a class that checks for the existence of a class:

if (!defined(Class["postfix::smtprelay"])) {
    include "postfix"

One would see the following in logs:

Nov  8 09:41:24 puppet01 puppet-master[19166]: Cannot find definition Class at /etc/puppet/manifests/nodes.pp:264 on node

A couple of thoughts come to mind:

1) Should this even be reported? Is programmatic logic something that should always be displayed? Granted, the class is clearly not found because its not defined, but that would still be considered normal behavior.

2) Even if it is to be included, it should be less ambiguous. Although one can easily find and then (correctly) assume what the warning is about given this information, it does take time.



#1 Updated by Nigel Kersten about 5 years ago

  • Status changed from Unreviewed to Accepted

#2 Updated by Nigel Kersten almost 5 years ago

  • Target version deleted (69)

I really dislike the defined() function :(

Also available in: Atom PDF