Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class

946 views
Skip to first unread message

Luke Tinker

unread,
Jun 5, 2016, 12:46:09 PM6/5/16
to Puppet Users, Luke Tinker
Hi Everyone,

I have some what exhausted my current readings from puppets documentation and presume I'm either misunderstanding something or I'm barking up the wrong tree...
currently i have modified the site.pp file to include apache just as a test to see if my environment is working,
r10k has made two environments both with puppetlabs apache module,
however when doing a puppet agent -t run i get 'Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class apache for server01 on node server01'
from my understanding of this error, it is due to the module path controlled by r10k not being loaded, resulting as fast puppet is concerned it doesn't know what that module is.
I ran 'puppet module list' and got the following.
/etc/puppet/environments/production/modules
├── abrader-gms (v1.0.2)
├── darshan-test_module (v0.1.0)
├── glarizza-osx_management (v0.2.1)
├── glarizza-property_list_key (v0.2.1)
├── maestrodev-ssh_keygen (v1.3.1)
├── puppetlabs-apache (v1.10.0)
├── puppetlabs-concat (v2.1.0)
├── puppetlabs-firewall (v1.8.1)
├── puppetlabs-inifile (v1.5.0)
├── puppetlabs-ntp (v4.2.0)
├── puppetlabs-registry (v1.1.3)
├── puppetlabs-stdlib (v4.12.0)
├── puppetlabs-vcsrepo (v1.3.2)
└── zack-r10k (v3.2.0)

this does show the apache module so I'm unsure whats up here,
the other thing i noticed is its not showing the modules in the development environment even though i would have thought that was using the same configuration,
if anyone could shed some light on what I'm doing wrong or can point me in the right direction to getting modules to actually work when included,
id be very grateful.

further details on my setup are as follows,

My environment consists of the following product versions.
Puppet 3.8.7,
r10k 2.2.2,
hiera 1.3.4,
facter 2.4.6,

I have setup the following in the puppet.conf
ini_setting { 'Configure environmentpath':
  section => 'main',
  setting => 'environmentpath',
  value   => '$confdir/environments',

ini_setting { 'Configure basemodulepath':
  section => 'main',
  setting => 'basemodulepath',
  value   => '$confdir/modules:/opt/puppet/share/puppet/modules',

each environment has the following in its environmnet.config file
modulepath          = modules:site:$basemodulepath

Regards,
Luke 

Lowe Schmidt

unread,
Jun 5, 2016, 1:18:36 PM6/5/16
to puppet...@googlegroups.com, Luke Tinker
Could you show us the node classification please. 

--
Lowe Schmidt | +46 723 867 157

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f1616846-fd59-4528-809f-316f5efa13d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luke Tinker

unread,
Jun 5, 2016, 9:34:38 PM6/5/16
to Puppet Users, luke....@anu.edu.au

Hi Lowe,


Its just being defined in the default class, i have also tried using it as a class

‘''

## site.pp ## /etc/puppet/environments/production/manifests/site.pp


# This file (/etc/puppet/manifests/site.pp) is the main entry point

# used when an agent connects to a master and asks for an updated configuration.

#

# Global objects like filebuckets and resource defaults should go in this file,

# as should the default node definition. (The default node can be omitted

# if you use the console and don't define any other nodes in site.pp. See

# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on

# node definitions.)


## Active Configurations ##


# Disable filebucket by default for all File resources:

#http://docs.puppetlabs.com/pe/latest/release_notes.html#filebucket-resource-no-longer-created-by-default

File { backup => false }


# DEFAULT NODE

# Node definitions in this file are merged with node data from the console. See

# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on

# node definitions.


# The default node definition matches any node lacking a more specific node

# definition. If there are no other nodes in this file, classes declared here

# will be included in every node's catalog, *in addition* to any classes

# specified in the console for that node.


node default {

  # This is where you can declare classes for all nodes.

  # Example:

  #   class { 'my_class': }

#class { 'apache': }

include apache

}

#

‘’'


Regards,

Luke

jcbollinger

unread,
Jun 6, 2016, 10:09:53 AM6/6/16
to Puppet Users

I ran 'puppet module list' and got the following.
/etc/puppet/environments/production/modules

[...]

And are you certain that node server01 is in the 'production' environment?  That is the default, but you do mention that you have at least one other.

Does file /etc/puppet/environments/production/modules/apache/manifests/init.pp exist on the master?  Is it, and every directory in the path to it, accessible to the master process (which ordinarily runs unprivileged)?

Do you see any relevant diagnostics in the master's log that you can correlate with the diagnostic emitted by the agent?


John

Luke Tinker

unread,
Jun 10, 2016, 11:33:23 PM6/10/16
to Puppet Users
Looks to actually be an issue with selinux,
im still looking into it as its not actually logging the issue,
but setting selinux to permissive is resolving the problem,

since this isn't a puppet issue i was barking up the wrong tree.
Reply all
Reply to author
Forward
0 new messages