Ask Your Question

couldn't find class

asked 2016-06-17 12:53:57 -0600

Chutki gravatar image

updated 2016-06-21 01:41:09 -0600


I have installed pe 2015.3.1 and I am doing testing with sample custom modules

class test::test1{
$enbl =  "running"
include test::test1


class test::test2{
include 'test::test1'
service { 'ntpd':
ensure => $test::test1::enbl
include test::test2

when I run puppet apply -t --noop test2.pp getting below error

Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::test::test1 for at /etc/puppetlabs/code/environments/production/modules/test/test2.pp:2:1 on node

part ||

Debug: Facter: fact "memory" has resolved to {
  swap => {
    available => "385.92 MiB",
    available_bytes => 404668416,
    capacity => "81.16%",
    total => "2.00 GiB",
    total_bytes => 2147479552,
    used => "1.62 GiB",
    used_bytes => 1742811136
  system => {
    available => "117.90 MiB",
    available_bytes => 123629568,
    capacity => "93.72%",
    total => "1.83 GiB",
    total_bytes => 1968386048,
    used => "1.72 GiB",
    used_bytes => 1844756480
Debug: Facter: resolving load_average facts.
Debug: Facter: fact "load_averages" has resolved to {
  15m => 0.69,
  1m => 0.85,
  5m => 1.02
Debug: Facter: resolving Xen facts.
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::test::test1 for at /etc/puppetlabs/code/environments/production/modules/test/test2.pp:2:1 on node



    certname =
    server =
    user  = pe-puppet
    group = pe-puppet
    archive_files = true
    archive_file_server =
    module_groups = base+pe_only
    environmentpath = /etc/puppetlabs/code/environments
    basemodulepath = /etc/puppetlabs/code/modules
    parser = future

    graph = true

app_management = false
node_terminus = classifier
storeconfigs = true
storeconfigs_backend = puppetdb
reports = puppetdb
certname =
always_cache_features = true
edit retag flag offensive close merge delete


I'm at a loss. PE 2015.3.1 should be equivalent to OS Puppet 4.3.2, which is what I'm running, and I don't have an issue with those class files. Maybe go back to basics - does "puppet apply -t --noop test1.pp" work? Are file permissions correct?

JohnsonEarls gravatar imageJohnsonEarls ( 2016-06-20 08:23:15 -0600 )edit

still I am getting same error. should I update something in site.pp "import classname", how we do for earlier puppet version.

Chutki gravatar imageChutki ( 2016-06-20 11:45:41 -0600 )edit

I have used "inherits" rather than "include", "class test::test2 inherits test::test1" not I am getting "Error: Could not find parent resource type '::test::test1' of type hostclass in production at line 1 on node". I included puppet.conf in the above question part.

Chutki gravatar imageChutki ( 2016-06-21 01:36:43 -0600 )edit

Chutki, what happens when you run "puppet apply -t --noop test1.pp" ?

JohnsonEarls gravatar imageJohnsonEarls ( 2016-06-21 07:32:17 -0600 )edit

I am not getting any error. "Info: Loading facts Info: Loading facts Notice: Compiled catalog for in environment production in 0.23 seconds Info: Applying configuration version '1466568341' Notice: Applied catalog in 0.31 seconds" this is the output

Chutki gravatar imageChutki ( 2016-06-21 23:06:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-22 17:26:04 -0600

rnelson0 gravatar image

Can you share the file layout? Even though you're using puppet apply, it will use the autoload method to find classes, and unless test1.pp is located at $modulepath/test/manifests/test.1pp, the autoloader probably cannot find it. But that's just a guess, we need a little more info to confirm or eliminate that possible cause.

edit flag offensive delete link more



I am extremely sorry to trouble you it is a problem with manifests directory, had a typo. I changed the spelling of manifests directory and it worked perfectly. thanks a million.

Chutki gravatar imageChutki ( 2016-06-22 20:21:57 -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



Asked: 2016-06-17 12:53:57 -0600

Seen: 3,019 times

Last updated: Jun 22 '16