Issue with puppetrun from Foreman

Hi,

I am not sure if anyone is still facing this problem with Foreman or not,
but when I try to execute puppetrun from Foreman for a specific host, its
throwing Internal Server Error.
I went through some threads and some say this issue is with puppet when
running with Webrick, but not when used with passenger. So, any help will
be useful.

OS - Centos 6.6
Foreman Version -
Puppet version - 3.8.3

Using default Foreman with Passenger, getting below error when I am
executing puppetrun -

··· === failed to execute puppetrun: ERF12-4252 [ProxyAPI::ProxyException]: Unable to execute Puppet run ([RestClient::InternalServerError]: 500 Internal Server Error) for proxy ===

On the agent node, in puppet logs, I see this -

Could not retrieve catalog from remote server: Could not intern from
text/pson: no ‘environments’ in
{:root_environment=>#<Puppet::Node::Environment:0x7f40253539c0
@name=:“root

I have already followed these steps to setup puppetrun -
http://projects.theforeman.org/projects/foreman/wiki/Puppetrun

Note that when I run puppet agent from commandline, it works fine.

Also, puppet kick agent-hostname from master returns the following.

puppet kick --ping --host puppet-agent-1

Warning: Puppet kick is deprecated. See
http://links.puppetlabs.com/puppet-kick-deprecation
Warning: Failed to load ruby LDAP library. LDAP functionality will not be
available
Triggering puppet-agent-1
Error: Host puppet-agent-1 failed: Error 400 on SERVER: no 'environments’
in {:root_environment=>#<Puppet::Node::Environment:0x7f40253539c0
@name=:“root”, @modulepath=[], @watching=true, @config_version=nil,
@manifest=:no_manifest>,
:current_environment=>#<Puppet::Node::Environment:0x7f40253539c0
@name=:“root”, @modulepath=[], @watching=true, @config_version=nil,
@manifest=:no_manifest>} at top of [[0, nil, nil]]

puppet-agent-1 finished with exit code 2


Hi Sayan,

There are 3 main mechanisms for performing puppet runs via foreman's gui.
Out of the 3, puppet kick is deprecated and I never got puppet-kick to work
anyway. I did get it to work using puppetssh. Here's thread that really
help me for setting this up:

https://groups.google.com/forum/#!topic/foreman-users/Hc9jpn0ljEc

The final mechanism is using mcollective. That's a bit more involved, but
if you need something quick then go for puppetssh approach.

Kind regards,
Sher

··· On Thursday, November 5, 2015 at 11:02:27 AM UTC, Sayan Das wrote: > > Hi, > > I am not sure if anyone is still facing this problem with Foreman or not, > but when I try to execute puppetrun from Foreman for a specific host, its > throwing Internal Server Error. > I went through some threads and some say this issue is with puppet when > running with Webrick, but not when used with passenger. So, any help will > be useful. > > OS - Centos 6.6 > Foreman Version - > Puppet version - 3.8.3 > > Using default Foreman with Passenger, getting below error when I am > executing puppetrun - > === > failed to execute puppetrun: ERF12-4252 [ProxyAPI::ProxyException]: Unable > to execute Puppet run ([RestClient::InternalServerError]: 500 Internal > Server Error) for proxy > === > > On the agent node, in puppet logs, I see this - > === > Could not retrieve catalog from remote server: Could not intern from > text/pson: no 'environments' in > {:root_environment=># @name=:"*root*" > ... > .. > === > > > I have already followed these steps to setup puppetrun - > http://projects.theforeman.org/projects/foreman/wiki/Puppetrun > > > Note that when I run puppet agent from commandline, it works fine. > > Also, puppet kick agent-hostname from master returns the following. > --- > # puppet kick --ping --host puppet-agent-1 > Warning: Puppet kick is deprecated. See > http://links.puppetlabs.com/puppet-kick-deprecation > Warning: Failed to load ruby LDAP library. LDAP functionality will not be > available > Triggering puppet-agent-1 > Error: Host puppet-agent-1 failed: Error 400 on SERVER: no 'environments' > in {:root_environment=># @name=:"*root*", @modulepath=[], @watching=true, @config_version=nil, > @manifest=:no_manifest>, > :current_environment=># @name=:"*root*", @modulepath=[], @watching=true, @config_version=nil, > @manifest=:no_manifest>} at top of [[0, nil, nil]] > > puppet-agent-1 finished with exit code 2 > > --- > >