6

I've an error on my Puma Application Server which runs Redmine application. The puma starts correctly and quickly next http calls return this error ... I do not find answer on Google how to handle this.

Here's the error message :

==> log/puma.stderr.log <==
/home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/single.rb:16:in `stop': undefined method `stop' for nil:NilClass (NoMethodError)
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/launcher.rb:146:in `stop'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/launcher.rb:382:in `block in setup_signals'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack.rb:85:in `<module:Digest>'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack.rb:81:in `<module:Auth>'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack.rb:77:in `<module:Rack>'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack.rb:12:in `<top (required)>'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/configuration.rb:300:in `rack_builder'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/configuration.rb:315:in `load_rackup'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/configuration.rb:243:in `app'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/runner.rb:127:in `load_and_bind'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/single.rb:85:in `run'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/launcher.rb:172:in `run'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/lib/puma/cli.rb:74:in `run'
    from /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/puma-3.6.0/bin/puma:10:in `<top (required)>'
    from /home/david/.rbenv/versions/2.3.1/bin/puma:23:in `load'
    from /home/david/.rbenv/versions/2.3.1/bin/puma:23:in `<main>'

Here's information about this server :

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.5.1
  - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
  - USER INSTALLATION DIRECTORY: /home/david/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /home/david/.rbenv/versions/2.3.1/bin/ruby
  - EXECUTABLE DIRECTORY: /home/david/.rbenv/versions/2.3.1/bin
  - SPEC CACHE DIRECTORY: /home/david/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/david/.rbenv/versions/2.3.1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/david/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0
     - /home/david/.gem/ruby/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/david/.rbenv/versions/2.3.1/bin
     - /home/david/.rbenv/libexec
     - /home/david/.rbenv/plugins/ruby-build/bin
     - /home/david/.rbenv/shims
     - /home/david/.rbenv/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
$ gem list puma

*** LOCAL GEMS ***

puma (3.6.0)

The problem do not seems to happen when I execute puma by myself in a console like this :

$ puma -C /home/david/public_html/redmine/config/puma.rb

But the problem occurs when I run the service I've created with this file :

# cat /etc/systemd/system/redmine.service 
[Unit]
Description=Puma HTTP Server (Redmine)
After=network.target

# Uncomment for socket activation (see below)
# Requires=puma.socket

[Service]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple

# Preferably configure a non-privileged user
User=david

# Specify the path to your puma application root
WorkingDirectory=/home/david/public_html/redmine

# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1

# The command to start Puma
# Here we are using a binstub generated via:
# `bundle binstubs puma --path ./sbin`
# in the WorkingDirectory (replace <WD> below)
# You can alternatively use `bundle exec --keep-file-descriptors puma`
# ExecStart=<WD>/sbin/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem

# Alternatively with a config file (in WorkingDirectory) and
# comparable `bind` directives
# ExecStart=<WD>/sbin/puma -C config.rb
ExecStart=/home/david/.rbenv/shims/puma -C /home/david/public_html/redmine/config/puma.rb


Restart=always

[Install]
WantedBy=multi-user.target

Thank you for your help,
David.
David
  • 755
  • 1
  • 9
  • 22
  • Which Redmine version? The latest one [doesn't seem](https://github.com/redmine/redmine/search?utf8=%E2%9C%93&q=puma&type=Code) to be using Puma. Also, what's the content of config/puma.rb? – Halil Özgür Oct 11 '16 at 19:16
  • Redmine 3.3.0.stable. Which application launcher do you recommand ? – David Oct 12 '16 at 07:52
  • `$ cat public_html/redmine/config/puma.rb #!/usr/bin/env puma # https://gist.github.com/jbradach/6ee5842e5e2543d59adb # start puma with: # RAILS_ENV=production bundle exec puma -C ./config/puma.rb application_path = '/home/david/public_html/redmine' directory application_path environment 'production' daemonize true pidfile "#{application_path}/tmp/pids/puma.pid" state_path "#{application_path}/tmp/pids/puma.state" stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" bind "unix://#{application_path}/tmp/sockets/redmine.sock"` – David Oct 12 '16 at 07:53
  • Well, Puma is OK but I'm not a Redmine user. I guess you've already seen them but, here are some resources: [1](https://blog.rudeotter.com/install-redmine-with-nginx-puma-and-mariadbmysql-on-ubuntu-14-04/), [2](http://www.redmine.org/projects/redmine/wiki/redmineinstall), [3](https://gist.github.com/licvido/cbea6b20d5d7a368751fb63d88165c2f). – Halil Özgür Oct 12 '16 at 13:25
  • Yes I saw theses ressources (I used the 1st for the major part of the deploiement, 2nd do not speak about application launcher and the 3rd do not speak about Systemd script). I think that my problem come from my systemd script. But I do not find the error. – David Oct 13 '16 at 13:52
  • @David Did you ever solve your problem? – Michael Johann Oct 31 '17 at 16:08

0 Answers0