Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I get the error

[anadi@bangda ~]# tail -f /var/log/nginx/error.log 
[ pid=19741 thr=23597654217140 file=utils.rb:176 time=2012-09-17 12:52:43.307 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (no such file to load -- puppet/application/master) (process 19741, thread #<Thread:0x2aec83982368>):
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from config.ru:13
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /usr/local/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1

when I start nginx server with passenger module configured, puppet master configured to run through rack.

here is the config.ru

[anadi@bangda ~]# cat /etc/puppet/rack/config.ru
# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.

# if puppet is not in your RUBYLIB:
#$:.unshift('/usr/share/puppet/lib')

$0 = "master"

# if you want debugging:
# ARGV << "--debug"

ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

and the nginx configuration for puppet master is as follows

[anadi@bangda ~]# cat /etc/nginx/conf.d/puppet-master.conf 
server {
  listen                     8140 ssl;
  server_name                bangda.mycompany.com;

  passenger_enabled          on;
  passenger_set_cgi_param    HTTP_X_CLIENT_DN $ssl_client_s_dn; 
  passenger_set_cgi_param    HTTP_X_CLIENT_VERIFY $ssl_client_verify; 

  access_log                 /var/log/nginx/puppet/master.access.log;
  error_log                  /var/log/nginx/puppet/master.error.log;

  root                       /etc/puppet/rack/public;

  ssl_certificate            /var/lib/puppet/ssl/certs/bangda.mycompany.com.pem;
  ssl_certificate_key        /var/lib/puppet/ssl/private_keys/bangda.mycompany.com.pem;
  ssl_crl                    /var/lib/puppet/ssl/ca/ca_crl.pem;
  ssl_client_certificate     /var/lib/puppet/ssl/certs/ca.pem;
  ssl_ciphers                SSLv2:-LOW:-EXPORT:RC4+RSA;
  ssl_prefer_server_ciphers  on;
  ssl_verify_client          optional;
  ssl_verify_depth           1;
  ssl_session_cache          shared:SSL:128m;
  ssl_session_timeout        5m;
}

however when I run puppet through the ususal puppetmasterd daemon it works perfect with no errors.

I can see somehow the nginx+passenger+rack setup fails to initialize while the same works when running the natvie puppetmaster daemon.

Any configuration that I am missing?

Update:Solved got it to work thanks to @Shane Madden's comment

puppet is located in

/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb

while ruby libs expect it to load from

/usr/local/lib/ruby/site_ruby/1.8/

hence changed the config.ru like so

# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.

# if puppet is not in your RUBYLIB:
$:.unshift('/usr/lib/ruby/site_ruby/1.8/')

$0 = "master"

# if you want debugging:
# ARGV << "--debug"

ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

Works now.

share|improve this question
    
What process did you use to install puppet? –  Shane Madden Sep 18 '12 at 3:32
    
added the puppet repos, puppet version installed is 2.7.19. ruby version: 1.8.7-p370 (built from source) rubygems - 1.3.7 (built from source) nginx - 1.2.3 (built from source) gem versions: passenger (3.0.17) rack (1.4.1) rack-cache (1.2) rack-ssl (1.3.2) –  Anadi Misra Sep 18 '12 at 8:21
    
Ok, the default location should be fine then. Try uncommenting the $:.unshift('/usr/share/puppet/lib') line? (remove the #) –  Shane Madden Sep 18 '12 at 18:26
    
@AnadiMisra: feel free to post it as an answer and accept when possible: blog.stackoverflow.com/2011/07/… –  quanta Sep 20 '12 at 4:53
    
@ShaneMadden should post the answer for Andadi to accept. But good job to both of you. –  pjmorse Oct 2 '12 at 10:32

1 Answer 1

up vote 1 down vote accepted

Solved got it to work thanks to @Shane Madden's comment

puppet is located in

/usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb

while ruby libs expect it to load from

/usr/local/lib/ruby/site_ruby/1.8/

hence changed the config.ru like so

# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.

# if puppet is not in your RUBYLIB:
$:.unshift('/usr/lib/ruby/site_ruby/1.8/')

$0 = "master"

# if you want debugging:
# ARGV << "--debug"

ARGV << "--rack"
require 'puppet/application/master'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
run Puppet::Application[:master].run

Works now.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.