Re: [Puppet Users] (New To Puppet)Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class sudo for pupclient on node pupclient

3,112 views
Skip to first unread message

Iain Sutton

unread,
Jan 20, 2013, 9:40:54 PM1/20/13
to puppet...@googlegroups.com
It looks like a syntax issue (at a minimum):

package { "sudo-ldap":
        ensure => present,
        require => Package["sudo],
        }
}

There isn't a trailing doublequote for the "sudo" line.

On 20 January 2013 16:38, Fusebox <dnvi...@gmail.com> wrote:
Hello Folks!

I am trying to learn puppet. Installed the puppet 3.0.2 and configured one node as the master and the other as the client. Generated the certs and all that. But, I seem to be doing something wrong wrt to the init.pp file. Attached is exact error and my current server configuration. Any help in helping me fix this issue is appreciated:

[root@pupclient ~]# puppet agent --test
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class sudo for pupclient on node pupclient
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

puppet.conf file on the client is pointed to the server which I named as puppet and which the client is able to resolve in DNS.
[root@pupclient ~]# cat /etc/puppet/puppet.conf
[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
server=puppet

[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


Below is the configuration on the puppet master:

[root@puppet manifests]# pwd
/etc/puppet/manifests

[root@puppet manifests]# cat site.pp
import 'nodes.pp'
$puppetserver = 'puppet'

[root@puppet manifests]# cat nodes.pp
node 'pupclient' {
include sudo
package {'firefox': ensure => present}
}

[root@puppet manifests]# pwd
/etc/puppet/modules/sudo/manifests

[root@puppet manifests]# ls -l
total 4
-rw-r--r-- 1 root root 327 Jan 19 23:15 init.pp

[root@puppet manifests]# cat init.pp
class sudo {
package { sudo:
        ensure => present,
}
if $operatingsystem == "Ubuntu" {
package { "sudo-ldap":
        ensure => present,
        require => Package["sudo],
        }
}
file { "/etc/sudoers":
        owner => root,
        group => root,
        mode => 0440,
        source => "puppet://$puppetserver/modules/sudo/etc/sudoers",
        require => Package["sudo"],
        }
}

Is this error result of a syntax issue or something else?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/elQPK2m6uLkJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Fusebox

unread,
Jan 21, 2013, 8:10:49 PM1/21/13
to puppet...@googlegroups.com
yeah..I figured that out after posting..works after fixing it.. but thanks for looking into it and responding..appreciate much :)

Jason Cochard

unread,
Jan 22, 2013, 4:31:56 PM1/22/13
to puppet...@googlegroups.com
Something to help you avoid it in the future:

Put all of your puppet manifests into a git repo (very good practice to get setup right away), and then put a git pre-commit hook that uses puppet parser validate to check for syntax errors.  This will basically not let you commit new manifests if they have syntax problems.  Much more efficient troubleshooting.  

This site covers the details:
Reply all
Reply to author
Forward
0 new messages