Ask Your Question

Error 400 could not find class - Class not shown in console

asked 2016-04-21 09:48:33 -0600

todds gravatar image

updated 2016-04-25 08:53:24 -0600

Using Puppet Enterprise version 4.3.1 I am having a weird issue where the console can''t find one of my classes. I'm using r10k to pull the module from git and install it in the correct path with this structure


|-- manifests


class apache {

  include apache::package
  include apache::config
  include apache::service



class apache::config {

  file { '/opt/csw/apache2/etc/httpd.conf':
    ensure  => 'file',
    owner   => 'apache',
    group   => 'apache',
    mode    => '0744',
    content => template(httpd.conf.erb),

The error is "could not find class ::apache::config" When I look at the Classification --> Add new class in the console I can add apache class, and apache::service, apache::package, and apache::params classes show up in the combo box, but apache::config does not.

Also I've used puppet-lint to check config.pp and no errors show up. Any ideas on what could be wrong?

edit retag flag offensive close merge delete


Looks like youre using the wrong path for your module. What is the output of puppet config print modulepath

UBPClaw gravatar imageUBPClaw ( 2016-04-25 12:51:01 -0600 )edit

the output of the command is /etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/puppet/modules:/opt/p uppetlabs/puppet/modules But we're using r10k who installs the modules (for this environment) in /etc/puppetlabs/code/environments/testing/modules

todds gravatar imagetodds ( 2016-04-25 14:11:47 -0600 )edit

I also want to add that the path /etc/puppetlabs/code/environments/testing/modules works for other modules, and the parent, and other classes, just not apache::config class.

todds gravatar imagetodds ( 2016-04-25 14:41:02 -0600 )edit

Two things to check: (1) make sure the config.pp file has the correct permissions and ownership; (2) run "puppet parser validate config.pp"

JohnsonEarls gravatar imageJohnsonEarls ( 2016-04-26 08:05:38 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-26 11:02:54 -0600

JohnsonEarls gravatar image

updated 2016-04-26 21:20:19 -0600

It looks like you have a syntax error in your class:

    content => template(httpd.conf.erb),

There should be quotes around httpd.conf.erb, and it should be referenced by the module name :

    content => template("${module_name}/httpd.conf.erb"),

edit- add module name to template invocation

edit flag offensive delete link more


Hello, Well adding quotes and the module name to the erb path has fixed the issue. I would not normally relate that to the error I received but I guess so. Thanks for your help. And thanks to everyone who responded.

todds gravatar imagetodds ( 2016-04-29 12:14:22 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-04-21 09:48:33 -0600

Seen: 74 times

Last updated: Apr 26 '16