The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

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 https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #5368

Using a parameterized class that doesn't exist results in a confusing error.

Added by Jordan Sissel over 5 years ago. Updated about 2 years ago.

Status:AcceptedStart date:11/19/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:error reporting
Target version:-
Affected Puppet version:2.6.4 Branch:
Keywords:parameterized class classes confusing error message
parameterized_classes

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/PUP-1720


Description

Error message: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type class at …

I expected that ‘include foo’ and ‘class { “foo”: …; }’ should result in the same error message if class ‘foo’ does not exist.

For example:

% puppet apply -e 'include notbar'
Could not find class notbar at line 1 on node snack.home

% puppet apply -e 'class { "notbar": ; }'
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type class at line 1 on node snack.home

Confirmed this problem is in both 2.6.2 and 2.6.3

History

#1 Updated by James Turnbull over 5 years ago

  • Category set to error reporting
  • Status changed from Unreviewed to Accepted
  • Target version set to 2.7.x

#2 Updated by Paul Berry over 5 years ago

  • Keywords changed from parameterized class classes confusing error message to parameterized class classes confusing error message parameterized_classes

#3 Updated by Anonymous about 5 years ago

  • Affected Puppet version changed from 2.6.2 to 2.6.4

This is still a problem in 2.6.4 — we just went through a lot of fun determining that a class we’d mistyped wasn’t a syntax error in our run stages setup, but just a typo in a class name. The error message needs to be much more accurate.

#4 Updated by Steven King about 5 years ago

I get an error when I use run stages such as

class { “class”: stage => pree }

but if the class you are assigning to a run stage is mispelled (does not exist) a very cryptic error is generated:

Feb 4 18:36:43 oas-test-1 puppet-agent[32454]: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type class at /etc/puppet/manifests/nodes.pp:41 on node test.host.com

#5 Updated by Erik Dalén about 4 years ago

You get the same type of confusing error if you try to use a defined type that uses include on a class that doesn’t exist.

#6 Updated by Anonymous over 3 years ago

  • Target version deleted (2.7.x)

#7 Updated by Anonymous over 3 years ago

As the 2.7.x line is winding down, I am removing the target at 2.7.x from tickets in the system. The 2.7 line should only receive fixes for major problems (crashes, for instance) or security problems.

Also available in: Atom PDF