Johan
Johan

Reputation: 5073

Puppet server gives "Error 400 on SERVER: Could not find class" but works masterless

I have a working environment using puppet provisioning with vagrant. Now I set up a puppetmaster server on AWS EC2 containing the same modules I use with vagrant, but when I try accessing it from an agent, I get Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class co_gocdserver for ip-172-31-34-78.us-west-2.compute.internal on node ip-172-31-34-78.us-west-2.compute.internal.

/etc/puppet/manifests/site.pp looks just like this at the moment:

node default {
  include co_gocdserver
}

/etc/puppet/modules/co_gocdserver/manifests/init.pp looks like:

class co_gocdserver {
 include gocd::server

 file { "ssh":
   path => "/var/go/.ssh",
   source => "puppet:///modules/co_baseconfig/ssh",
   recurse => true,
   require => Package["go-server"],
 }
}

Update: Here is /etc/puppet/puppet.conf at the master:

[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

    #node_name = facter
    #node_name_fact = puppet_node

    basemodulepath = /etc/puppet/modules

[master]
    basemodulepath = /etc/puppet/modules

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$confdir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

Is there any obvious error introduced or how can I debug this?

Upvotes: 1

Views: 698

Answers (1)

Johan
Johan

Reputation: 5073

Solved it. Problem was I had messed up with the permissions to the modules directory, and the puppetserver was running as user puppet which had no read access.

How could I mess up the permissions? Valid question. Simple answer:

rm -rf /etc/puppet/modules
ln -s /home/centos/puppet/modules /etc/puppet/modules

Keeping this thread as a reference.

Upvotes: 1

Related Questions