Ask Your Question

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find class motd

asked 2016-12-20 14:48:53 -0500

infcloud01 gravatar image

Hi, i'm new to puppet and just testing; I have a simple module I created that creates a motd file. When I use puppet apply -e 'include ::motd' the class is applied. But when the PE server tries to run it on the agent I always get this error. The same for when I run puppet agent -t.

I feel like this is a simple issue but I can't figure it out. Any help would be appreciated. Thank you in advance.

Here is my environment

the environment is production /etc/puppetlabs/code/environments the modules inatalled are /etc/puppetlabs/code/environments/production/modules ├── puppetlabs-stdlib (v4.13.1) └── serdelivery-motd (v0.1.0) /etc/puppetlabs/code/modules ├── Delivery-jboss (v0.1.0) ├── ntp (???) └── puppetlabs-stdlib (v4.14.0) /opt/puppetlabs/puppet/modules (no modules installed) the version of puppet is 4.8.0

Here is what's included in the init.pp file located in /etc/puppetlabs/code/environments/development/modules/motd/manifests

class motd { file { '/etc/motd': ensure => 'file', content => file('motd/message'), } }

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2016-12-21 22:29:45 -0500

infcloud01 gravatar image

Copying the module into the production modules folder on the master allowed it to work as suggested. Thanks.

edit flag offensive delete link more

answered 2016-12-21 10:58:39 -0500

stivesso gravatar image

updated 2016-12-21 10:59:21 -0500

Seems like you're mixing environment (agent is running under production environment, but your motd module is placed under development environment), copy your motd module under /etc/puppetlabs/code/environments/production/modules (as seen below) and test again.

cp -r /etc/puppetlabs/code/environments/development/modules/motd /etc/puppetlabs/code/environments/production/modules/
edit flag offensive delete link more


Hi, thank you for the quick response. i've tried but the same error .. the PE server also isn't setting the agent to development the environment is production /etc/puppetlabs/code/environments the modules inatalled /etc/puppetlabs/code/environments/production/modules └── serdelivery-motd (v0.1.0

infcloud01 gravatar imageinfcloud01 ( 2016-12-21 12:30:42 -0500 )edit

Please, run again "puppet module list" on the Master ( and share output) and also "puppet agent -t -d" on the client (and share the output as well).

stivesso gravatar imagestivesso ( 2016-12-21 12:37:41 -0500 )edit

I ran out of room to keep typing but the environment is production, even though my PE server class is development. puppet config print environment production

infcloud01 gravatar imageinfcloud01 ( 2016-12-21 12:40:48 -0500 )edit

stivesso, you helped me figure it out. The master didn't have the module in the production folder. It was only in the development environment. I still don't know why the agent is using production and not development but i'll look at that next . Thanks!

infcloud01 gravatar imageinfcloud01 ( 2016-12-21 13:44:27 -0500 )edit

so the agent is working correctly now too, but I still don't understand why I had to put my module into the production folder then development.

infcloud01 gravatar imageinfcloud01 ( 2016-12-21 13:55:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-12-20 14:48:53 -0500

Seen: 351 times

Last updated: Dec 21 '16