# "Could not find declared class" in development environment

Hi, runnning puppet 3.4.3 on ubuntu 14.04, and have a setup with a production and a development environment, which are identical (except a few spec files):

# diff -u -r /etc/puppet/environments/development/modules /etc/puppet/environments/production/modules
Only in /etc/puppet/environments/development/modules/apt/spec: fixtures
Only in /etc/puppet/environments/development/modules/epel/spec: fixtures
Only in /etc/puppet/environments/development/modules/erlang/spec: fixtures
Only in /etc/puppet/environments/development/modules/rabbitmq/spec: fixtures
Only in /etc/puppet/environments/development/modules/staging/spec/fixtures: manifests
Only in /etc/puppet/environments/development/modules/staging/spec/fixtures: modules
Only in /etc/puppet/environments/development/modules/stdlib/spec/fixtures: modules
# diff -u -r /etc/puppet/environments/development/manifests /etc/puppet/environments/production/manifests
#


However when I run a client using production (puppet agent -t) there are no errors and the config is applied, but if I connect to the development environment I get an error:

# puppet agent --test --environment=development
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class ::ntp at /etc/puppet/environments/development/manifests/site.pp:7 on node chiles.skyhigh
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
#


If I --no-daemonize --debug the server, the same error is printed when I use the development environment instead of the following lines which are printed when I use production environments:

Debug: importing '/etc/puppet/environments/production/modules/ntp/manifests/init.pp' in environment production
Debug: Automatically imported ntp from ntp into production
Debug: importing '/etc/puppet/environments/production/modules/ntp/manifests/params.pp' in environment production
Debug: Automatically imported ntp::params from ntp/params into production


this happened after upgrading the ntp module. What I cant figure out is that the two environments are identical (except for the spec files shown above) but still the development environment does not seem to compile

any help greatly appreciated

edit retag close merge delete

Sort by » oldest newest most voted

OK, finally fixed the problem myself with some good help from a colleauge, the source of the problem was that I had done a chmod -R 644 in the ntp module dir, and this of course does not show with the diff :)

(btw, if you do this in a module you will just get a "Error 400 on SERVER: Permission denied" when the agent contacts the puppetmaster and this is a good error message, but the problem is if you restart the puppetmaster, then the error becomes "Error 400 on SERVER: Puppet::Parser::AST::Resource failed ..." which is much harder to trace back to a permission problem)

A forced reinstall of the module fixed the problem:

puppet module install --force  puppetlabs-ntp --environment=development

more

## Stats

Seen: 6,631 times

Last updated: Aug 07 '14