Puppet ENC fails during run but works manually

Hi,

I’m seeing this error when running Puppet with Foreman ENC:

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node myserver.local: Exception while executing '/etc/puppetlabs/puppet/node.rb': Cannot run program "/etc/puppetlabs/puppet/node.rb" (in directory "."): error=0, Failed to exec spawn helper: pid: 737167, exit value: 1

However, running the ENC script manually works fine, No errors are shown in this case.:

/etc/puppetlabs/puppet/node.rb myserver.local

Where I see an error on the UI. with above error message.

  • Foreman version: 3.12.1
  • OS: Ubuntu 22.04 LTS

Thank you all

Neeloj

On Ubuntu, try to change the shebang in /etc/puppetlabs/puppet/node.rb to

#!/opt/puppetlabs/puppet/bin/ruby

1 Like

That is assuming that you already restarted the services, specifically puppetserver.

thanks @corvar

I get now different error:

/etc/puppetlabs/puppet/node.rb myagent.local

During fact upload occured an exception: SSL_connect returned=1 errno=0 peeraddr=10.10.10.10:443 state=error: certificate verify failed (unable to get local issuer certificate)

Serving cached ENC: Could not send facts to Foreman: SSL_connect returned=1 errno=0 peeraddr=10.10.10.10:443 state=error: certificate verify failed (unable to get local issuer certificate)

Unable to read from Cache file: No such file or directory @ rb_sysopen - /opt/puppetlabs/server/data/puppetserver/yaml/foreman/myagent.local.yaml