A puppet host works in "production" but not in any other environment

We are using Foreman 1.5 and Puppet 2.7.25 on CentOS 6.5. It is working
fine if the puppet clients are in the default "production" environment.
Once we move the machine to another environment (ex. DEV1) then we have
errors when running "puppet agent --test" from the puppet client.

Our master is gppdev1fore3.gpp and the client is gppdev1ftp1.gpp

Here's the error when we move the puppet client to DEV1:

[root@gppdev1ftp1 puppet]# puppet agent --test
notice: Ignoring --listen on onetime run
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
info: Loading facts in
/etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find class foo::filelist for gppdpdev1ftp1.gpp
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

Is there anything we need to manually modify on the puppet master or agent?

Here's the puppet.conf file on the agent (we manually added "environment =
DEV1" in the [agent] section):
QUOTE
[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

[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
environment = DEV1
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
server = gppdev1fore3.gpp
#runinterval=60
listen = true
UNQUOTE

We also run the puppet agent with the "–no-client" option:
root 27868 1 0 18:15 ? 00:00:02 /usr/bin/ruby
/usr/sbin/puppetd --server=gppdev1fore3.gpp --no-client

Joe

Here is the puppet masters puppet.conf

we have the "foo" module in both the production environment and in the DEV1
environments module path (same directories under each)

Generally I'd recommend changing the environment in Foreman itself, as
Puppet 3 and higher makes the master fully authoritative over the
client's environment by default.

Can you explain this statement (do you mean move the puppet master between
environments?)

File managed with puppet

Module: 'puppet'

[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

Allow services in the 'puppet' group to access key (Foreman + proxy)

privatekeydir = $ssldir/private_keys { group = service }
hostprivkey = $privatekeydir/$certname.pem { mode = 640 }

Puppet 3.0.x requires this in both [main] and [master] - harmless on

agents

autosign = $confdir/autosign.conf { mode = 664 }
show_diff = false

Next part of the file is managed by a different template

Module: '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 '$statedir/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

Disable the default schedules as they cause continual skipped

resources to be displayed in Foreman - only for Puppet >= 3.4

default_schedules = false

report = true

pluginsync = true

pluginsync = false
masterport = 8140
environment = production
certname = gppdev1fore3.gpp
server = gppdev1fore3.gpp
listen = false
splay = false
runinterval = 1800
noop = false
configtimeout = 120

Next part of the file is managed by a different template

Module: 'puppet'

[master]
autosign = $confdir/autosign.conf { mode = 664 }
reports = foreman
external_nodes = /etc/puppet/node.rb
node_terminus = exec
ca = true
ssldir = /var/lib/puppet/ssl
certname = gppdev1fore3.gpp
strict_variables = false

modulepath =
/etc/puppet/environments/$environment/modules:/etc/puppet/environments/common:/usr/share/puppet/modules

config_version =

[DEV1]
modulepath =
/etc/puppet/environments/DEV1/modules:/etc/puppet/environments/common:/usr/share/puppet/modules

config_version =

[development]
modulepath =
/etc/puppet/environments/development/modules:/etc/puppet/environments/common:/usr/share/puppet/modules

config_version =

[production]
modulepath =
/etc/puppet/environments/production/modules:/etc/puppet/environments/common:/usr/share/puppet/modules

config_version =

###end of puppet.conf

··· On Tuesday, May 27, 2014 2:32:20 PM UTC-4, Joseph Gori wrote: > > We are using Foreman 1.5 and Puppet 2.7.25 on CentOS 6.5. It is working > fine if the puppet clients are in the default "production" environment. > Once we move the machine to another environment (ex. DEV1) then we have > errors when running "puppet agent --test" from the puppet client. > > Our master is gppdev1fore3.gpp and the client is gppdev1ftp1.gpp > > Here's the error when we move the puppet client to DEV1: > > [root@gppdev1ftp1 puppet]# puppet agent --test > notice: Ignoring --listen on onetime run > info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb > info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb > info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb > info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Could not find class foo::filelist for gppdpdev1ftp1.gpp > warning: Not using cache on failed catalog > err: Could not retrieve catalog; skipping run > > Is there anything we need to manually modify on the puppet master or agent? > > Here's the puppet.conf file on the agent (we manually added "environment = > DEV1" in the [agent] section): > QUOTE > [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 > > [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 > environment = DEV1 > # Where puppetd caches the local configuration. An > # extension indicating the cache format is added automatically. > # The default value is '$confdir/localconfig'. > localconfig = $vardir/localconfig > server = gppdev1fore3.gpp > #runinterval=60 > listen = true > UNQUOTE > > We also run the puppet agent with the "--no-client" option: > root 27868 1 0 18:15 ? 00:00:02 /usr/bin/ruby > /usr/sbin/puppetd --server=gppdev1fore3.gpp --no-client > > Joe >

Can you show how your puppet master is set up? Its puppet.conf (with
modules paths) and where you modules are physically located on the
filesystem… perhaps your "foo::filelist" class isn't in the right place.

Generally I'd recommend changing the environment in Foreman itself, as
Puppet 3 and higher makes the master fully authoritative over the
client's environment by default.

··· -- Dominic Cleal Red Hat Engineering

On 27/05/14 19:32, Joseph Gori wrote:

We are using Foreman 1.5 and Puppet 2.7.25 on CentOS 6.5. It is working
fine if the puppet clients are in the default “production” environment.
Once we move the machine to another environment (ex. DEV1) then we have
errors when running “puppet agent --test” from the puppet client.

Our master is gppdev1fore3.gpp and the client is gppdev1ftp1.gpp

Here’s the error when we move the puppet client to DEV1:

[root@gppdev1ftp1 puppet]# puppet agent --test
notice: Ignoring --listen on onetime run
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
info: Loading facts in
/etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find class foo::filelist for gppdpdev1ftp1.gpp
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

Is there anything we need to manually modify on the puppet master or agent?

Here’s the puppet.conf file on the agent (we manually added “environment
= DEV1” in the [agent] section):
QUOTE
[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

[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
environment = DEV1
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is ‘$confdir/localconfig’.
localconfig = $vardir/localconfig
server = gppdev1fore3.gpp
#runinterval=60
listen = true
UNQUOTE

We also run the puppet agent with the “–no-client” option:
root 27868 1 0 18:15 ? 00:00:02 /usr/bin/ruby
/usr/sbin/puppetd --server=gppdev1fore3.gpp --no-client

Joe


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto:foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

I could run foreman-debug if that would help?

··· On Wednesday, May 28, 2014 5:31:33 AM UTC-4, Dominic Cleal wrote: > > Can you show how your puppet master is set up? Its puppet.conf (with > modules paths) and where you modules are physically located on the > filesystem.. perhaps your "foo::filelist" class isn't in the right place. > > Generally I'd recommend changing the environment in Foreman itself, as > Puppet 3 and higher makes the master fully authoritative over the > client's environment by default. > > -- > Dominic Cleal > Red Hat Engineering > > On 27/05/14 19:32, Joseph Gori wrote: > > We are using Foreman 1.5 and Puppet 2.7.25 on CentOS 6.5. It is working > > fine if the puppet clients are in the default "production" environment. > > Once we move the machine to another environment (ex. DEV1) then we have > > errors when running "puppet agent --test" from the puppet client. > > > > Our master is gppdev1fore3.gpp and the client is gppdev1ftp1.gpp > > > > Here's the error when we move the puppet client to DEV1: > > > > [root@gppdev1ftp1 puppet]# puppet agent --test > > notice: Ignoring --listen on onetime run > > info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb > > info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/root_home.rb > > info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/pe_version.rb > > info: Loading facts in > > /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > > Could not find class foo::filelist for gppdpdev1ftp1.gpp > > warning: Not using cache on failed catalog > > err: Could not retrieve catalog; skipping run > > > > Is there anything we need to manually modify on the puppet master or > agent? > > > > Here's the puppet.conf file on the agent (we manually added "environment > > = DEV1" in the [agent] section): > > QUOTE > > [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 > > > > [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 > > environment = DEV1 > > # Where puppetd caches the local configuration. An > > # extension indicating the cache format is added automatically. > > # The default value is '$confdir/localconfig'. > > localconfig = $vardir/localconfig > > server = gppdev1fore3.gpp > > #runinterval=60 > > listen = true > > UNQUOTE > > > > We also run the puppet agent with the "--no-client" option: > > root 27868 1 0 18:15 ? 00:00:02 /usr/bin/ruby > > /usr/sbin/puppetd --server=gppdev1fore3.gpp --no-client > > > > Joe > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to foreman-user...@googlegroups.com > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > To post to this group, send email to forema...@googlegroups.com > > <mailto:forema...@googlegroups.com >. > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > >

I'm having the same problem. Any host I create in an environment that
isn't in either of the two built-in environments (production and
development) receive Error 400 on SERVER: Could not find class errors.
Those exact same classes will run on hosts that are in either of the two
built-in environments. If I move a host from a new environment to a built
in one, that class will work. If I take a host from a built in environment
and move it to a new one, that same working class will fail. What are the
exact steps to create a new environment? I have edited puppet.conf on the
master by copying and pasting an existing environment and changing the name
path. I copied a module in the module path for the new environment, then
pressed import class in Foreman, and everything appears as it should.

Anyone know what might be wrong?

··· On Thursday, May 29, 2014 12:31:11 PM UTC-5, Joseph Gori wrote: > > I could run foreman-debug if that would help? > > > On Wednesday, May 28, 2014 5:31:33 AM UTC-4, Dominic Cleal wrote: >> >> Can you show how your puppet master is set up? Its puppet.conf (with >> modules paths) and where you modules are physically located on the >> filesystem.. perhaps your "foo::filelist" class isn't in the right place. >> >> Generally I'd recommend changing the environment in Foreman itself, as >> Puppet 3 and higher makes the master fully authoritative over the >> client's environment by default. >> >> -- >> Dominic Cleal >> Red Hat Engineering >> >> On 27/05/14 19:32, Joseph Gori wrote: >> > We are using Foreman 1.5 and Puppet 2.7.25 on CentOS 6.5. It is working >> > fine if the puppet clients are in the default "production" environment. >> > Once we move the machine to another environment (ex. DEV1) then we have >> > errors when running "puppet agent --test" from the puppet client. >> > >> > Our master is gppdev1fore3.gpp and the client is gppdev1ftp1.gpp >> > >> > Here's the error when we move the puppet client to DEV1: >> > >> > [root@gppdev1ftp1 puppet]# puppet agent --test >> > notice: Ignoring --listen on onetime run >> > info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb >> > info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/root_home.rb >> > info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/pe_version.rb >> > info: Loading facts in >> > /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb >> > err: Could not retrieve catalog from remote server: Error 400 on >> SERVER: >> > Could not find class foo::filelist for gppdpdev1ftp1.gpp >> > warning: Not using cache on failed catalog >> > err: Could not retrieve catalog; skipping run >> > >> > Is there anything we need to manually modify on the puppet master or >> agent? >> > >> > Here's the puppet.conf file on the agent (we manually added >> "environment >> > = DEV1" in the [agent] section): >> > QUOTE >> > [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 >> > >> > [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 >> > environment = DEV1 >> > # Where puppetd caches the local configuration. An >> > # extension indicating the cache format is added automatically. >> > # The default value is '$confdir/localconfig'. >> > localconfig = $vardir/localconfig >> > server = gppdev1fore3.gpp >> > #runinterval=60 >> > listen = true >> > UNQUOTE >> > >> > We also run the puppet agent with the "--no-client" option: >> > root 27868 1 0 18:15 ? 00:00:02 /usr/bin/ruby >> > /usr/sbin/puppetd --server=gppdev1fore3.gpp --no-client >> > >> > Joe >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Foreman users" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> > an email to foreman-user...@googlegroups.com >> > . >> > To post to this group, send email to forema...@googlegroups.com >> > . >> > Visit this group at http://groups.google.com/group/foreman-users. >> > For more options, visit https://groups.google.com/d/optout. >> >>

Have you imported the environments into Foreman?

I did import the environments. Since my last post I restored my Foreman VM
to a state before the installation and started again with 1.53. I am not
experiencing the problem now. I believe it may be because of some naming
convention issues I have since read about, but I will have to bring up the
other VM to make sure. I thought I had tested by renaming my classes. I
will write back if the issue comes back or can identify the problem with
the old VM by fixing the issue.

Thanks for responding.

··· On Saturday, September 6, 2014 7:07:26 PM UTC-5, Alyssa wrote: > > Have you imported the environments into Foreman? >