Ask Your Question
0

undefined method `exists?'

asked 2015-04-13 14:25:50 -0600

updated 2015-04-13 16:17:21 -0600

csharpsteen gravatar image

Puppet agent is returning this output only when running from the crontab and thus not getting the master definitions. Runs fine when running manually from the command line.

ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

puppet agent version: 3.7.5

Apr 13 11:37:02 foohost puppet-agent[19969]: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: undefined method `exists?' for nil:NilClass
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/type/user.rb:382:in `exists?'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings.rb:800:in `service_user_available?'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings/file_setting.rb:52:in `send'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings/file_setting.rb:52:in `safe_to_use_settings_value?'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings/file_setting.rb:43:in `value'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings/file_setting.rb:106:in `owner'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings/file_setting.rb:160:in `to_resource'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings.rb:916:in `to_catalog'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings.rb:912:in `each'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings.rb:912:in `to_catalog'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/settings.rb:982:in `use'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/application/agent.rb:404:in `setup'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/application.rb:378:in `run'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/application.rb:507:in `plugin_hook'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/application.rb:378:in `run'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/util.rb:488:in `exit_on_fail'
Apr 13 11:37:02 foohost puppet-agent[19969]: /usr/lib64/ruby/gems/1.8/gems/puppet-3.7.5/lib/puppet/application ...
(more)
edit retag flag offensive close merge delete

Comments

Thanks for your hint Greg. I see that there are some differences between the PATH on the crontab and environment PATH and I have corrected this and is now working fine.

Emerson Posadas gravatar imageEmerson Posadas ( 2015-04-14 10:40:45 -0600 )edit

Good to hear!

GregLarkin gravatar imageGregLarkin ( 2015-04-15 00:15:04 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-13 23:43:54 -0600

GregLarkin gravatar image

Do you have multiple versions of Puppet installed on the machine? Often when you see differences in behavior in cron vs. the command-line, it's caused by the (lack of) environment in cron. Can you double-check your PATH variable in cron vs command-line, for instance?

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2015-04-13 14:25:50 -0600

Seen: 172 times

Last updated: Apr 13 '15