puppetserver error: no such file to load -- pg on node puppetmaster1

163 views
Skip to first unread message

rhpupp...@gmail.com

unread,
Sep 17, 2015, 10:18:48 PM9/17/15
to Puppet Users
Our puppet master used to run using apache passenger stack. We've recently migrated from passenger to puppetserver. When i run puppet agent -vt on my client, its showing the following error. 

Error 400 on server : could not autoload puppet/parser/functions/get_location: no such file to load -- pg on node puppetmaster1

puppet master --version : 3.7.5
ruby --version : 1.8.7 patch level 374-2
---------------------
#cat puppet/parser/functions/get_location.rb
require 'rubygems'
require 'pg'
require 'resolv'

module Puppet::Parser::Funtions

xxxxxx
---------------------

I would appreciate if someone help me fixing this issue.

Martin Alfke

unread,
Sep 18, 2015, 2:51:44 AM9/18/15
to puppet...@googlegroups.com

On 18 Sep 2015, at 04:08, rhpupp...@gmail.com wrote:

> Our puppet master used to run using apache passenger stack. We've recently migrated from passenger to puppetserver. When i run puppet agent -vt on my client, its showing the following error.
>
> Error 400 on server : could not autoload puppet/parser/functions/get_location: no such file to load -- pg on node puppetmaster1
>
> puppet master --version : 3.7.5
> ruby --version : 1.8.7 patch level 374-2
> ---------------------
> #cat puppet/parser/functions/get_location.rb
> require 'rubygems'
> require 'pg'
> require ‘resolv'

It seems as if you are missing the pg ruby gem within puppet server:
sudo puppetserver gem install pg --no-ri --no-rdoc
see: https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown

Best,
Martin

>
> module Puppet::Parser::Funtions
>
> xxxxxx
> ---------------------
>
> I would appreciate if someone help me fixing this issue.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/e86265cf-cf4b-4b92-9657-64d5137adf59%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

rhpupp...@gmail.com

unread,
Sep 19, 2015, 3:14:02 PM9/19/15
to Puppet Users
Thanks Martin for replying. By the way, i'm following your seminars on youtube and they are very helpful. The error still persists.

I've tried this earlier but command failed with the following error. 
# puppetserver gem install pg --no-ri --no-rdoc
Building native extensions. This could take a while...
ERROR:  Error installing pg:
                ERROR: Failed to build gem native extension.

              java -jar /usr/share/puppetserver/puppet-server-release.jar -r ./siteconf20150919-17955-hjabmk.rb extconf.rb

Error(s) occured while parsing command-line arguments: Unknown option: "-r"

<--- some options ---->

extconf failed, uncaught signal 1

<--- some output 2 lines --->

=============================

Martin Alfke

unread,
Sep 20, 2015, 12:01:25 PM9/20/15
to puppet...@googlegroups.com

On 19 Sep 2015, at 21:14, rhpupp...@gmail.com wrote:

> Thanks Martin for replying. By the way, i'm following your seminars on youtube and they are very helpful. The error still persists.
>
> I've tried this earlier but command failed with the following error.
> # puppetserver gem install pg --no-ri --no-rdoc
> Building native extensions. This could take a while...
> ERROR: Error installing pg:
> ERROR: Failed to build gem native extension.
>
> java -jar /usr/share/puppetserver/puppet-server-release.jar -r ./siteconf20150919-17955-hjabmk.rb extconf.rb
>
> Error(s) occured while parsing command-line arguments: Unknown option: "-r"
>
> <--- some options ---->
>
> extconf failed, uncaught signal 1
>
> <--- some output 2 lines —>

Seems to be a bug.
I can reproduce this error on Debian 7 with puppetserver 2.1.1

I have opened a ticket at PuppetLabs: https://tickets.puppetlabs.com/browse/SERVER-905
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/bba04c2b-a309-4219-8a40-d381a7554be7%40googlegroups.com.

Martin Alfke

unread,
Sep 21, 2015, 6:13:25 PM9/21/15
to puppet...@googlegroups.com

On 20 Sep 2015, at 18:00, Martin Alfke <tux...@gmail.com> wrote:

>
> On 19 Sep 2015, at 21:14, rhpupp...@gmail.com wrote:
>
>> Thanks Martin for replying. By the way, i'm following your seminars on youtube and they are very helpful. The error still persists.
>>
>> I've tried this earlier but command failed with the following error.
>> # puppetserver gem install pg --no-ri --no-rdoc
>> Building native extensions. This could take a while...
>> ERROR: Error installing pg:
>> ERROR: Failed to build gem native extension.
>>
>> java -jar /usr/share/puppetserver/puppet-server-release.jar -r ./siteconf20150919-17955-hjabmk.rb extconf.rb
>>
>> Error(s) occured while parsing command-line arguments: Unknown option: "-r"
>>
>> <--- some options ---->
>>
>> extconf failed, uncaught signal 1
>>
>> <--- some output 2 lines —>
>
> Seems to be a bug.
> I can reproduce this error on Debian 7 with puppetserver 2.1.1
>
> I have opened a ticket at PuppetLabs: https://tickets.puppetlabs.com/browse/SERVER-905

I love PuppetLabs guys for their fast feedback and detailed descriptions:
Quoting Chris:
"I think this is probably expected behavior; Puppet Server runs JRuby, and JRuby doesn't support gems with native extensions. For most of the common gems that fall into this category, there is a suitable alternative that does work with JRuby. You can find general docs on this subject on the JRuby wiki, here:
https://github.com/jruby/jruby/wiki/C-Extension-Alternatives
It looks like, for pg, they're recommending the activerecord-jdbcpostgresql-adapter instead. Maybe that will be sufficient for your use case?"

In your case: puppetserver works as expected.
I will close the ticket with PL.
Reply all
Reply to author
Forward
0 new messages