Puppet 3.0 upgrade issue

826 views
Skip to first unread message

Thomas Bendler

unread,
Oct 8, 2012, 5:43:56 AM10/8/12
to puppet...@googlegroups.com
Hi @all,

after upgrading my puppet server to Puppet 3.0 I got the following error every time a client connect to the server:

[ pid=1532 thr=70147393710520 file=utils.rb:176 time=2012-10-08 11:17:56.504 ]: *** Exception NoMethodError in PhusionPassenger::Rack::ApplicationSpawner (undefined method `settings' for Puppet:Module) (process 1532, thread #<Thread:0x7f98ecf7d370>):
        from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:273:in `run_mode'
        from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:5
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from config.ru:13
        from /usr/lib/ruby/gems/1.8/gems/rack-1.2.5/lib/rack/builder.rb:46:in `instance_eval'
        from /usr/lib/ruby/gems/1.8/gems/rack-1.2.5/lib/rack/builder.rb:46:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1

I use the following components:

$ rpm -qa | grep passenger
rubygem-passenger-3.0.12-1.el6.x86_64
mod_passenger-3.0.12-1.el6.x86_64
passenger-release-3-6.el6.noarch
rubygem-passenger-native-libs-3.0.12-1.el6_1.8.7.352.x86_64
rubygem-passenger-native-3.0.12-1.el6.x86_64
$ rpm -qa | grep puppet
puppet-3.0.0-1.el6.noarch
puppetlabs-release-6-6.noarch
puppet-server-3.0.0-1.el6.noarch
$ rpm -qa | grep http
httpd-tools-2.2.15-15.sl6.1.x86_64
httpd-2.2.15-15.sl6.1.x86_64
httpd-devel-2.2.15-15.sl6.1.x86_64
$

Any hints?

Reards, Thomas
--
Linux ... enjoy the ride!

Henrik Lindberg

unread,
Oct 8, 2012, 10:35:20 AM10/8/12
to puppet...@googlegroups.com
On 2012-08-10 11:43, Thomas Bendler wrote:
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.

run_mode is deprecated as a setting in 3.x - do you have it in some
settings file?

It can still be used on the command line.

(Don't have the issue link at hand right now...) will post it later.
- henrik

Thomas Bendler

unread,
Oct 8, 2012, 11:04:20 AM10/8/12
to puppet...@googlegroups.com
2012/10/8 Henrik Lindberg <henrik....@cloudsmith.com>
[...]

run_mode is deprecated as a setting in 3.x - do you have it in some settings file?
It can still be used on the command line.
[...]

I don't think that I used run_mode anywhere:

$ cd /etc/puppet/
$ grep -R run_mode *
$ cd /var/lib/puppet/
$ grep -R run_mode *
$ cd /etc/httpd/
$ grep -R run_mode * | grep -v logs
$

But it look like it is used by Puppet itself:

$ cd /usr/lib/ruby/site_ruby/1.8/puppet
$ grep -R run_mode * | cut -d ':' -f 1 | uniq | sort -rn
util/run_mode.rb
util/log/destinations.rb
test/test_helper.rb
ssl/certificate_authority.rb
settings.rb
network/server.rb
network/http/webrick.rb
indirector/yaml.rb
indirector/json.rb
indirector/facts/yaml.rb
indirector/face.rb
indirector/catalog/compiler.rb
face/node.rb
face/node/clean.rb
face/help/man.erb
face/facts.rb
face/config.rb
defaults.rb
daemon.rb
application/secret_agent.rb
application.rb
application/master.rb
application/inspect.rb
application/doc.rb
application/device.rb
application/cert.rb
application/certificate.rb
application/ca.rb
application/agent.rb
$ rpm -qf application/agent.rb
puppet-3.0.0-1.el6.noarch
$

Regards, Thomas

Thomas Bendler

unread,
Oct 8, 2012, 11:40:19 AM10/8/12
to puppet...@googlegroups.com
Hi Gary,

2012/10/8 Gary Titchmarsh <gary.ti...@gmail.com>
[...]
Looking at this link to the breaking changes, you need to amend your config.ru:
Comment out the following lines:
[...]

thanks for the tip, you got me into the right direction. I thought the hole time I was using the config.ru from the RPM package but instead I used a copy which wasn't upgraded. Replacing the config.ru with the current version solved the problem.

Regards, Thomas

Forrie

unread,
Oct 18, 2012, 5:37:20 PM10/18/12
to puppet...@googlegroups.com
I'm running into a similar problem; however, even the changes to config.ru don't seem to make a difference.   First, here are the GEMs I have installed:

daemon_controller (1.0.0)
facter (1.6.13)
fastthread (1.0.7)
ffi (1.1.5)
hiera (1.1.0, 1.0.0)
json (1.7.5)
libvirt-ruby (1.0.2)
passenger (3.0.17)
puppet (3.0.1)
puppet-lint (0.3.1)
puppet-module (0.3.4)
rack (1.4.1)
rack-protection (1.2.0)
rake (0.9.2.2)
rubygems-update (1.8.24)
sinatra (1.3.3)
stomp (1.2.6)
tilt (1.3.3)
tzinfo (0.3.33)

I built a staging system to test out Puppet 3.0.1 and Passenger, latest versions.   I have another similar system, running Puppet 2.x with Passenger which is working fine.

Here is my config.ru (hash comments removed for brevity):


$0 = "master"
ARGV << "--rack"  
ARGV << "--confdir" << "/etc/puppet" 
require 'puppet/util/command_line' 
run Puppet::Util::CommandLine.new.execute


The file is owned by puppet:puppet as is the Rack directory, which is /etc/puppet/rack/puppetmasterd/public 

My /etc/httpd/conf.d/passenger.conf is simple enough:


LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.17
PassengerRuby /usr/local/bin/ruby

Listen 8140

<VirtualHost *:8140>

SSLEngine On
# SSLCipherSuite SSLv2:-LOW:-EXPORT:RC4+RSA
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP
SSLCertificateFile /var/lib/puppet/ssl/certs/stage1.myserver.com.pem
SSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/stage1.myserver.com.pem
SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem
SSLCACertificateFile /var/lib/puppet/ssl/ca/ca_crt.pem

SSLCARevocationFile /var/lib/puppet/ssl/ca/ca_crl.pem
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars

# The following client headers allow the same configuration to work with Pound.
RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e

PassengerHighPerformance on
PassengerMaxPoolSize 15
PassengerPoolIdleTime 300
PassengerUseGlobalQueue on
PassengerStatThrottleRate 120
RackAutoDetect On
RailsAutoDetect Off


RackBaseURI /
DocumentRoot /etc/puppet/rack/puppetmasterd/public


<Directory "/etc/puppet/rack/puppetmasterd/public">
Options None
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>



I've tried this with the AutoDetect of Rails and Rack on|off.   What I see is httpd starts up fine, along with the Passenger processes, but there is no puppet.

I can run puppet by itself with no trouble, however.

I've been poring over this since yesterday and I honestly can't figure out what's wrong.   Unless it has to do with GEM versions that are not working correctly?

Before I put this out into production, I want to be sure the steps to get this working are clearly documented in case it breaks, etc.


Thanks.

Jeff McCune

unread,
Oct 18, 2012, 5:47:04 PM10/18/12
to puppet...@googlegroups.com
On Thu, Oct 18, 2012 at 2:37 PM, Forrie <for...@gmail.com> wrote:

Here is my config.ru (hash comments removed for brevity):


$0 = "master"
ARGV << "--rack"  
ARGV << "--confdir" << "/etc/puppet" 
require 'puppet/util/command_line' 
run Puppet::Util::CommandLine.new.execute

I overlooked a setting for 3.0.0 and it's fixed in the 3.0.1 example config.ru.


Could you try adding ARGV << "--vardir" << "/var/lib/puppet" (Or, whatever is the default for your platform)?

-Jeff

Forrie

unread,
Oct 18, 2012, 5:52:16 PM10/18/12
to puppet...@googlegroups.com
I added that and restarted httpd (stop, then start) and still no luck.   Here is what passenger-status says:

----------- General information -----------
max      = 15
count    = 0
active   = 0
inactive = 0
Waiting on global queue: 0

----------- Application groups -----------



So it's not even seeing the Application.    Yet, something binds to the port as I can't start "puppet master" while Passenger is running.

My Platform is CentOS 5 64-bit.

Ellison Marks

unread,
Oct 18, 2012, 6:02:22 PM10/18/12
to puppet...@googlegroups.com
Is it the case that the application doesn't technically "exist" until an agent tries to hit the port?

Forrie

unread,
Oct 18, 2012, 6:36:01 PM10/18/12
to puppet...@googlegroups.com
Interesting question - I tested this out and it does indeed seem to be the case.   Unexpected behavior, however.  

Ramin K

unread,
Oct 18, 2012, 6:44:24 PM10/18/12
to puppet...@googlegroups.com
On 10/18/2012 3:36 PM, Forrie wrote:
> Interesting question - I tested this out and it does indeed seem to be
> the case. Unexpected behavior, however.

Standard behavior under Passenger. If you want Puppet to start
immediately when the webserver starts do the following.

1. Make sure you're using Passenger 3.0.x
2. Add this line to the bottom of your Puppet vhost outside the
VirtualHost bits

PassengerPreStart https://puppet.mydomain.com:8140

3. Assuming you want Puppet Rack process running at all times, set this
in your passenger module conf file or also in the vhost file

PassengerMinInstances 1

Ramin

Forrie

unread,
Oct 18, 2012, 6:54:36 PM10/18/12
to puppet...@googlegroups.com, ramin...@badapple.net
Thanks for that pointer... I put that in my config.
Reply all
Reply to author
Forward
0 new messages