Foreman or Puppet problem?

Now that I have my proxy template issue resolved I've got a host that needs
to be a puppet agent of a local "puppetmaster" (that is an agent of the
foreman alpha server) and having some problems. Now, I've done this locally
(foreman-alpha puppet, puppetmaster that is agent of the alpha and each has
3 puppet agent "nodes" underneath. Something like this:

  • foreman host
    -puppet ALPHA

  • host1 (puppet smart-proxy)
    -puppet master (agent of ALPHA)
    –host1a
    —puppet agent of host1
    –host1b
    —puppet agent of host1
    –host1c
    —puppet agent of host1

  • host2 (puppet smart-proxy)
    -puppet master (agent of ALPHA)
    –host2a
    —puppet agent of host2
    –host2b
    —puppet agent of host2
    –host2c
    —puppet agent of host2

  • host3 (puppet smart-proxy)
    -puppet master (agent of ALPHA)
    –host3a
    —puppet agent of host3
    –host3b
    —puppet agent of host3
    –host3c
    —puppet agent of host3

These hosts are all under the same vhost in the same network. They all work
just fine and use the same configuration as the host with the problem. The
new host, I'll call host4a is the one having the problem.

  • host4 (dhcp/tftp/puppet/template smart proxy)
    -puppet master (agent of ALPHA)
    –host4a
    —puppet agent of host4

Host1, Host2, Host3 and Host4 all have the same puppet.conf configuration
outside of hostnames for themselves. Puppet on host4 runs fine. I've sync'd
the module/code directory with the foreman ALPHA server.

Here is where I have the problem, with host4a. The puppet runs complain:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER:
{"message":"Server Error: Could not find class motd for host4a.name.com on
node
host4a.name.com","issue_kind":"RUNTIME_ERROR","stacktrace":["/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:382:in
evaluate_classes'","org/jruby/RubyArray.java:2409:incollect'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:381:in
evaluate_classes'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:251:inevaluate_node_classes'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:180:in
compile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:inprofile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in
profile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:180:incompile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in
override'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:inoverride'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:162:in
compile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:33:incompile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:266:in
compile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:inprofile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in
profile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:264:incompile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in
benchmark'","/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/lib/ruby/1.9/benchmark.rb:295:inrealtime'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:222:in
benchmark'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:262:incompile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/catalog/compiler.rb:53:in
find'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:infind'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:121:in
do_find'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:48:incall'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in
override'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:241:inoverride'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:47:in
call'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:inprocess'","org/jruby/RubyArray.java:1613:in
each'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:inprocess'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:in
process'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:87:inprocess'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:60:in
process'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:inprofile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in
profile'","/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:58:inprocess'","file:/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/puppetserver-lib/puppet/server/master.rb:42:in
handleRequest'","Puppet$$Server$$Master_261410000.gen:13:inhandleRequest'","request_handler_core.clj:273:in
invoke'","jruby_request.clj:46:ininvoke'","jruby_request.clj:31:in
invoke'","request_handler_service.clj:34:inhandle_request'","request_handler.clj:3:in
invoke'","request_handler.clj:3:ininvoke'","core.clj:2493:in
invoke'","master_core.clj:428:ininvoke'","ring.clj:21:in
invoke'","ring.clj:12:ininvoke'","comidi.clj:249:in
invoke'","ring_middleware.clj:284:ininvoke'","core.clj:168:in
invoke'","core.clj:211:ininvoke'","core.clj:45:in
invoke'","core.clj:343:ininvoke'","core.clj:51:in
invoke'","ringutils.clj:86:ininvoke'","legacy_routes_core.clj:114:in
invoke'","legacy_routes_core.clj:94:ininvoke'","legacy_routes_core.clj:184:in
invoke'","legacy_routes_core.clj:151:ininvoke'","ring.clj:21:in
invoke'","ring.clj:12:ininvoke'","comidi.clj:249:in
invoke'","jetty9_core.clj:424:ininvoke'","normalized_uri_helpers.clj:80:in `invoke'"]}
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

puppet.conf for host4a is the same as host1a/host2a/host3a except it uses
host4a as it's puppet master.

If I tweak the puppet.conf on host4a.host.com and set it to use the foreman
host (ALPHA) it works when I run "puppet agent --test".

If move it back to use host4 as it's puppet master and then remove the
"motd" module from it's foreman/module/class config it will just complain
the same error on the next module. If I remove ALL modules puppet then
runs… but obviously I need the modules to be there.

I've reviewed the puppet logs and the foreman-proxy (and foreman logs) but
there doesn't seem to be a direct error that leads me to the cause.

I also have reviewed the smart proxy/class/host group settings trying to
see if there is something I left out from the new host4/host4a since the
only difference from these and the ones that work are it is on a different
compute resource… but didn't see anything obvious.

Anyone have suggestions on where I might look at this for a cause?

> Here is where I have the problem, with host4a. The puppet runs complain:
> >
> Error: Could not retrieve catalog from remote server: Error 500 on
> SERVER: {"message":"Server Error: Could not find class motd for
> host4a.name.com on node
> host4a.name.com", […]
>

The error indicates that Foreman is specifying the "motd" module must be
applied, but it isn't on the Puppet master. It's likely that it's in the
wrong location, or a setting such as the environmentpath in puppet.conf
is incorrect.

> I also have reviewed the smart proxy/class/host group settings trying to
> see if there is something I left out from the new host4/host4a since the
> only difference from these and the ones that work are it is on a
> different compute resource… but didn't see anything obvious.

Assuming the environments are meant to be identical, I don't think this
is related at all to Foreman.

> Anyone have suggestions on where I might look at this for a cause?

If you show the exact locations of the modules, manifests and
puppet.conf (plus version), it might be possible to say what the issue is.

··· On 13/10/16 21:24, Mike Wilson wrote:


Dominic Cleal
dominic@cleal.org

You are 100% correct! I kept over looking that fact because I would search
for the module and find it but… the path was wrong. When I rsync'd it
over I used the full path which meant it went to /etc/puppetlabs/code/code
and not /etc/puppetlabs/code.

I've corrected the mistake and all is well. Thank you so much for pointing
out the obvious to my old eyes.

··· On Friday, October 14, 2016 at 2:25:39 AM UTC-5, Dominic Cleal wrote: > > On 13/10/16 21:24, Mike Wilson wrote: > > Here is where I have the problem, with host4a. The puppet runs complain: > > > > > Error: Could not retrieve catalog from remote server: Error 500 on > > SERVER: {"message":"Server Error: Could not find class motd for > > host4a.name.com on node > > host4a.name.com", [..] > > > > The error indicates that Foreman is specifying the "motd" module must be > applied, but it isn't on the Puppet master. It's likely that it's in the > wrong location, or a setting such as the environmentpath in puppet.conf > is incorrect. >