Ask Your Question

puppet server cant load 'rest-client', but gem is installed.

asked 2017-08-31 01:47:04 -0500

uherbst gravatar image

updated 2017-08-31 01:49:35 -0500

Hi all, I see this error on my puppet agent:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/solace_messagevpn: no such file to load -- rest-client at /etc/puppetlabs/code/environments/development/manifests/solace_tier2.pp:10:3 on node xxxx

I read it this way: the puppet server (!) can't load rest-client.

BUT: The puppet server ruby has installed that gem:

[root@xxx ~]# puppetserver gem list

*** LOCAL GEMS ***

domain_name (0.5.20170404)
http-cookie (1.0.3)
jar-dependencies (0.2.6)
jruby-openssl (0.9.16 java)
json (1.8.0 java) 
mime-types (2.99.3)
netrc (0.11.0)
rake (10.1.0)
rdoc (4.1.2)
rest-client (1.8.0)
unf (0.1.4 java)

AND for sure: I've restarted the puppetserver after installing the rest-client gem. Any ideas, what is the problem now ?

edit retag flag offensive close merge delete


Solved. It were missing rx-permissions on gems-directories and missing r-permissions on gems-files. You can debug this with: /opt/puppetlabs/puppet/bin/irb require 'rest-client' Compare results as root and as non-root-users....

uherbst gravatar imageuherbst ( 2017-09-06 05:17:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-31 01:55:19 -0500

uherbst gravatar image

Ok, further analyzing with irb:

as root: [root@xxx ~]# puppetserver irb irb(main):001:0> require 'rest-client' => true

=> Looks good. No errors

as user puppet: $ puppetserver irb irb(main):001:0> require 'rest-client' LoadError: no such file to load -- rest-client ...

Ok, I'll check permissions.

edit flag offensive delete link more


I had to work through similar things... we had modified the system umask value as a part of our hardening setup, and that jacked up the gem permissions when they got installed. We had to specificically call out the correct umask for gem installs so they would work as expected, or CHMOD afterwards

DarylW gravatar imageDarylW ( 2017-09-01 07:36:32 -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: 2017-08-31 01:47:04 -0500

Seen: 22 times

Last updated: Aug 31