Having issue with Unicorn
- by Imdad @ 10/24 - next

I have rails4, nginx, unicorn and mona for app deployed
http://104.131.74.69/

But after deploy hitting on above link results in error, and the log says

root@Hailisys:~# tail -n 0 -f
/var/www/hailisys/shared/log/unicorn.stderr.log
I, [2014-10-24T17:28:53.162084 #15819]  INFO -- : executing
["/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
"/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
{11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/28)
/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
`exec': No such file or directory -
/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn
(Errno::ENOENT)
from
/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
`block in reexec'
from
/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:447:in
`fork'
from
/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:447:in
`reexec'
from
/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:307:in
`join'
from
/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in
`<top (required)>'
from
/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
`load'
from
/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
`<main>'
E, [2014-10-24T17:28:53.440532 #8814] ERROR -- : reaped #<Process::Status:
pid 15819 exit 1> exec()-ed


And am not sure how to fix it, please help

Cheers!
Imdad Ali Khan
Mob (0) 9818484057
http://www.linkedin.com/in/imdad

message raw reply permalink

  Re: Having issue with Unicorn
  - by Eric Wong @ 10/24 - next/prev

  Imdad <khanimdad@gmail.com> wrote:
  > I have rails4, nginx, unicorn and mona for app deployed
  > http://104.131.74.69/
  > 
  > But after deploy hitting on above link results in error, and the log says
  > 
  > root@Hailisys:~# tail -n 0 -f
  > /var/www/hailisys/shared/log/unicorn.stderr.log
  > I, [2014-10-24T17:28:53.162084 #15819]  INFO -- : executing
  > ["/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
  > "/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
  > {11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/28)
  
  You're working inside /releases/28 here...
  
  > /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
  > `exec': No such file or directory -
  > /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn
  > (Errno::ENOENT)
  
  However, it's trying to run out of /releases/6, which I assume is
  old enough to be removed by now.
  
  You should be able to set working_directory in your config/unicorn.rb:
  
  	working_directory "/var/www/hailisys/current"
  
  Then SIGHUP to reload the config before sending SIGUSR2 to it.
  
  Hopefully that works.  Normally you shouldn't need to set
  working_directory if you're working out of "/current";
  but I'm not sure what your deploy environment looks like.

  message raw reply parent permalink

    Re: Having issue with Unicorn
    - by Imdad @ 10/24 - next/prev

    Thanks Eric, here is my deploy.rb and config/unicorn.rb
    NOTE: /releases/6 and /releases/28 both have same error message
    
    config/unicorn.rb
    ==============
    # Set your full path to application.
    app_dir = File.expand_path('../../', __FILE__)
    shared_dir = File.expand_path('../../../shared/', __FILE__)
    
    # Set unicorn options
    worker_processes 2
    preload_app true
    timeout 30
    
    # Fill path to your app
    working_directory app_dir
    
    # Set up socket location
    listen "#{shared_dir}/sockets/unicorn.sock", :backlog => 64
    
    # Loging
    stderr_path "#{shared_dir}/log/unicorn.stderr.log"
    stdout_path "#{shared_dir}/log/unicorn.stdout.log"
    
    # Set master PID location
    pid "#{shared_dir}/pids/unicorn.pid"
    
    before_fork do |server, worker|
      defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!
      old_pid = "#{server.config[:pid]}.oldbin"
      if File.exists?(old_pid) && server.pid != old_pid
        begin
          sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
          Process.kill(sig, File.read(old_pid).to_i)
        rescue Errno::ENOENT, Errno::ESRCH
          # someone else did our job for us
        end
      end
    end
    
    after_fork do |server, worker|
      defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
    end
    
    before_exec do |server|
      ENV['BUNDLE_GEMFILE'] = "#{app_dir}/Gemfile"
    end
    
    deploy.rb
    ==========
    require 'mina/bundler'
    require 'mina/rails'
    require 'mina/git'
    require 'mina/rbenv'  # for rbenv support. (http://rbenv.org)
    # require 'mina/rvm'    # for rvm support. (http://rvm.io)
    # TODO: Look into this later
    #require 'mina_sidekiq/tasks'
    require 'mina/unicorn'
    
    
    # Basic settings:
    #   domain       - The hostname to SSH to.
    #   deploy_to    - Path to deploy into.
    #   repository   - Git repo to clone from. (needed by mina/git)
    #   branch       - Branch name to deploy. (needed by mina/git)
    set_default :rbenv_path, "/root/.rbenv" #{}"/root/.rbenv"
    #set_default :bundle_path, '/root/.rbenv/shims/bundle'
    #set_default :bundle_bin, 'bundle exec'
    
    set :domain, '104.131.74.69'
    
    set :deploy_to, '/var/www/hailisys'
    
    set :repository, 'https://gitlab.com/hailisys/hailisys.git'
    set :branch, 'master'
    set :user, 'root'
    set :forward_agent, true
    # MOIN: Fix Password issue
    set :term_mode, nil
    # MOIN: Could be staging, production
    set :rails_env, 'production'
    set :port, '22'
    set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"
    
    # For system-wide RVM install.
    #   set :rvm_path, '/usr/local/rvm/bin/rvm'
    
    # Manually create these paths in shared/ (eg: shared/config/database.yml)
    in your server.
    # They will be linked in the 'deploy:link_shared_paths' step.
    set :shared_paths, ['config/database.yml', 'log']
    
    # Optional settings:
    #   set :user, 'foobar'    # Username in the server to SSH to.
    #   set :port, '30000'     # SSH port number.
    #   set :forward_agent, true     # SSH forward_agent.
    
    # This task is the environment that is loaded for most commands, such as
    # `mina deploy` or `mina rake`.
    task :environment do
      # If you're using rbenv, use this to load the rbenv environment.
      # Be sure to commit your .rbenv-version to your repository.
      invoke :'rbenv:load'
    
      # For those using RVM, use this to load an RVM version@gemset.
      # invoke :'rvm:use[ruby-1.9.3-p125@default]'
    end
    
    # Put any custom mkdir's in here for when `mina setup` is ran.
    # For Rails apps, we'll make some of the shared paths that are shared
    between
    # all releases.
    
    task :setup => :environment do
      queue! %[mkdir -p "#{deploy_to}/shared/log"]
      queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]
    
      queue! %[mkdir -p "#{deploy_to}/shared/config"]
      queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]
    
      queue! %[mkdir -p "#{deploy_to}/shared/pids"]
      queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/pids"]
    
      queue! %[mkdir -p "#{deploy_to}/shared/sockets"]
      queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/sockets"]
    
      queue! %[touch "#{deploy_to}/shared/config/database.yml"]
      queue  %[echo "-----> Be sure to edit 'shared/config/database.yml'."]
    
      # sidekiq needs a place to store its pid file and log file
      queue! %[mkdir -p "#{deploy_to}/shared/pids/"]
      queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/pids"]
    end
    
    desc "Deploys the current version to the server."
    task :deploy => :environment do
      deploy do
    
        # stop accepting new workers
        # TODO: Look into this later
        # invoke :'sidekiq:quiet'
    
        # Put things that will set up an empty directory into a fully set-up
        # instance of your project.
        invoke :'git:clone'
        invoke :'deploy:link_shared_paths'
        invoke :'bundle:install'
        invoke :'rails:db_migrate'
        invoke :'rails:assets_precompile'
        invoke :'deploy:cleanup'
    
        to :launch do
          # Passenger
          # queue "mkdir -p #{deploy_to}/#{current_path}/tmp/"
          # queue "touch #{deploy_to}/#{current_path}/tmp/restart.txt"
    
          # TODO: Look into this later
          # invoke :'sidekiq:restart'
          invoke :'unicorn:restart'
          #invoke :'unicorn:start'
          #queue "touch #{deploy_to}/tmp/restart.txt"
    
        end
      end
    end
    
    # For help in making your deploy script, see the Mina documentation:
    #
    #  - http://nadarei.co/mina
    #  - http://nadarei.co/mina/tasks
    #  - http://nadarei.co/mina/settings
    #  - http://nadarei.co/mina/helpers
    
    Please suggest what could be wrong.
    
    
    Cheers!
    Imdad Ali Khan
    Mob (0) 9818484057
    http://www.linkedin.com/in/imdad
    
    On 24 October 2014 23:15, Eric Wong <e@80x24.org> wrote:
    
    > <Imdad <khanimdad@gmail.com> wrote: > > I have rails4, nginx, ...>

    message raw reply parent permalink

      Re: Having issue with Unicorn
      - by Eric Wong @ 10/24 - next/prev

      Imdad <khanimdad@gmail.com> wrote:
      > Thanks Eric, here is my deploy.rb and config/unicorn.rb
      > NOTE: /releases/6 and /releases/28 both have same error message
      > 
      > config/unicorn.rb
      > ==============
      > # Set your full path to application.
      > app_dir = File.expand_path('../../', __FILE__)
      > shared_dir = File.expand_path('../../../shared/', __FILE__)
      
      Using __FILE__ with File.expand_path here gets you in trouble
      because it loses track of symlinks like "current"
      
      The following should be more explicit, I think:
      
      	app_dir = "/var/www/hailisys/current"
      	shared_dir = "/var/www/hailisys/shared"
      
      And the rest of the config/unicorn.rb should pick those up as-is.
      
      > set :deploy_to, '/var/www/hailisys'
      
      Maybe you can export :deploy_to from your deploy config to your
      unicorn invocation to DRY-up your config/unicorn.rb config.
      
      So perhaps, something like:
      
      	app_dir = "#{ENV['deploy_to']}/current"
      	shared_dir = "#{ENV['deploy_to']}/shared"

      message raw reply parent permalink

        Re: Having issue with Unicorn
        - by Imdad @ 10/24 - next/prev

        Updates app_dir and shared_dir as stated here then did a deploy which went
        okay, but my app still not running and log spit the following...
        
        root@Hailisys:/var/www/hailisys/shared/log# tail -n 20 -f
        unicorn.stderr.log
        I, [2014-10-24T17:28:53.162084 #15819]  INFO -- : executing
        ["/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
        "/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
        {11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/28)
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
        `exec': No such file or directory -
        /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn
        (Errno::ENOENT)
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
        `block in reexec'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:447:in
        `fork'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:447:in
        `reexec'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:307:in
        `join'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in
        `<top (required)>'
        from
        /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
        `load'
        from
        /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
        `<main>'
        E, [2014-10-24T17:28:53.440532 #8814] ERROR -- : reaped #<Process::Status:
        pid 15819 exit 1> exec()-ed
        I, [2014-10-24T18:21:54.882454 #16594]  INFO -- : executing
        ["/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
        "/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
        {11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/29)
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
        `exec': No such file or directory -
        /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn
        (Errno::ENOENT)
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
        `block in reexec'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:447:in
        `fork'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:447:in
        `reexec'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:307:in
        `join'
        from
        /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in
        `<top (required)>'
        from
        /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
        `load'
        from
        /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
        `<main>'
        E, [2014-10-24T18:21:55.053890 #8814] ERROR -- : reaped #<Process::Status:
        pid 16594 exit 1> exec()-ed
        
        
        Cheers!
        Imdad Ali Khan
        Mob (0) 9818484057
        http://www.linkedin.com/in/imdad
        
        On 24 October 2014 23:43, Eric Wong <e@80x24.org> wrote:
        
        > <Imdad <khanimdad@gmail.com> wrote: > > Thanks Eric, here is ...>

        message raw reply parent permalink

          Re: Having issue with Unicorn
          - by Eric Wong @ 10/24 - next/prev

          Imdad <khanimdad@gmail.com> wrote:
          > Updates app_dir and shared_dir as stated here then did a deploy which went
          > okay, but my app still not running and log spit the following...
          
          I think you need to SIGHUP the existing master before SIGUSR2:
          
             1) update config/unicorn.rb on the server
             2) SIGHUP master to reload new config # manual step to fix up config
             3) proceed with SIGUSR2 as usual
          
          Also, please don't send HTML portions or quote too much,
          it wastes bandwidth and storage.  Thanks.

          message raw reply parent permalink

            Re: Having issue with Unicorn
            - by Imdad @ 10/24 - next/prev

            Thanks Eric, not how to do
             2) SIGHUP master to reload new config # manual step to fix up config
             3) proceed with SIGUSR2 as usual
            
            Also not sure how did i send HTML portions
            
            Cheers!
            Imdad Ali Khan
            Mob (0) 9818484057
            http://www.linkedin.com/in/imdad
            
            On 25 October 2014 00:04, Eric Wong <e@80x24.org> wrote:
            
            > <Imdad <khanimdad@gmail.com> wrote: > > Updates app_dir and ...>

            message raw reply parent permalink

              Re: Having issue with Unicorn
              - by Imdad @ 10/24 - next/prev

              FYI - after deploy, config/unicorn.rb is already updated
              app_dir = app_dir = "/var/www/hailisys/current"#File.expand_path('../../',
              __FILE__)
              shared_dir = "/var/www/hailisys/shared"
              
              
              Cheers!
              Imdad Ali Khan
              Mob (0) 9818484057
              http://www.linkedin.com/in/imdad
              
              On 25 October 2014 00:09, Imdad <khanimdad@gmail.com> wrote:
              
              > <Thanks Eric, not how to do > 2) SIGHUP master to reload new config # ...>

              message raw reply parent permalink

              Re: Having issue with Unicorn
              - by Eric Wong @ 10/24 - next/prev

              Imdad <khanimdad@gmail.com> wrote:
              > Thanks Eric, not how to do
              >  2) SIGHUP master to reload new config # manual step to fix up config
              >  3) proceed with SIGUSR2 as usual
              
              I think you need to do this fix manually by logging into your server:
              
              	kill -HUP $(cat /path/to/pid/file)
              	kill -USR2 $(cat /path/to/pid/file)
              
              (SIGUSR2 is what you were doing before with the reexec)
              
              > Also not sure how did i send HTML portions
              
              Your initial message got through fine (HTML is given a high spam score).

              message raw reply parent permalink

                Re: Having issue with Unicorn
                - by Imdad @ 10/24 - next/prev

                Did following by login to server
                
                root@Hailisys:/var/www/hailisys/shared/pids# kill -HUP $(cat unicorn.pid)
                root@Hailisys:/var/www/hailisys/shared/pids# kill -USR2 $(cat unicorn.pid)
                
                
                Then did "mina deploy"
                
                -----> Launching
                -----> Restart unicorn service
                -----> Done. Deployed v30
                Connection to 104.131.74.69 closed.
                       Elapsed time: 52.96 seconds
                
                
                
                And here is my log file  (/var/www/hailisys/shared/log/unicorn.stderr.log)
                
                INFO -- : executing
                ["/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
                "/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
                {11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/30)
                /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:475:in
                `exec': No such file or directory -
                /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn
                (Errno::ENOENT)
                from
                /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http
                
                
                
                
                Cheers!
                Imdad Ali Khan
                Mob (0) 9818484057
                http://www.linkedin.com/in/imdad
                
                On 25 October 2014 00:43, Eric Wong <e@80x24.org> wrote:
                
                > <Imdad <khanimdad@gmail.com> wrote: > > Thanks Eric, not how ...>

                message raw reply parent permalink

                  Re: Having issue with Unicorn
                  - by Eric Wong @ 10/24 - next/prev

                  Imdad <khanimdad@gmail.com> wrote:
                  > INFO -- : executing
                  > ["/var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c"
                  
                  Gack, we missed that having the wrong path, too.  You probably need
                  this in your config/unicorn.rb:
                  
                     Unicorn::HttpServer::START_CTX[0] =
                          "/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/bin/unicorn"
                  
                  And do the HUP/USR2 again.  And if it fails again, show us the logs
                  right after the HUP, too.  Thanks.

                  message raw reply parent permalink

                    Re: Having issue with Unicorn
                    - by Imdad @ 10/24 - next/prev

                    Here you go...
                    root@Hailisys:/var/www/hailisys/shared/pids# kill -HUP $(cat unicorn.pid)
                    root@Hailisys:/var/www/hailisys/shared/pids# kill -USR2 $(cat unicorn.pid)
                    root@Hailisys:/var/www/hailisys/shared/pids# cd ..
                    root@Hailisys:/var/www/hailisys/shared# tail -n 20 -f
                    log/unicorn.stderr.log
                    E, [2014-10-24T19:55:54.656013 #8814] ERROR -- :
                    /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/util.rb:39:in
                    `each'
                    E, [2014-10-24T19:55:54.656044 #8814] ERROR -- :
                    /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/util.rb:39:in
                    `reopen_logs'
                    E, [2014-10-24T19:55:54.656119 #8814] ERROR -- :
                    /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:743:in
                    `load_config!'
                    E, [2014-10-24T19:55:54.656150 #8814] ERROR -- :
                    /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:325:in
                    `join'
                    E, [2014-10-24T19:55:54.656179 #8814] ERROR -- :
                    /var/www/hailisys/current/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/bin/unicorn:126:in
                    `<top (required)>'
                    E, [2014-10-24T19:55:54.656206 #8814] ERROR -- :
                    /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
                    `load'
                    E, [2014-10-24T19:55:54.656233 #8814] ERROR -- :
                    /var/www/hailisys/releases/6/vendor/bundle/ruby/2.1.0/bin/unicorn:23:in
                    `<main>'
                    I, [2014-10-24T19:55:54.795603 #8814]  INFO -- : reaped #<Process::Status:
                    pid 17502 exit 0> worker=0
                    I, [2014-10-24T19:55:54.803712 #18246]  INFO -- : worker=0 ready
                    I, [2014-10-24T19:55:54.838425 #8814]  INFO -- : reaped #<Process::Status:
                    pid 17505 exit 0> worker=1
                    I, [2014-10-24T19:55:54.851649 #18249]  INFO -- : worker=1 ready
                    I, [2014-10-24T19:56:16.054817 #18256]  INFO -- : executing
                    ["/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
                    "/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
                    {11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/31)
                    I, [2014-10-24T19:56:16.626199 #18256]  INFO -- : inherited
                    addr=/var/www/hailisys/shared/sockets/unicorn.sock fd=11
                    I, [2014-10-24T19:56:16.626930 #18256]  INFO -- : Refreshing Gem list
                    I, [2014-10-24T19:56:18.723512 #18256]  INFO -- : master process ready
                    I, [2014-10-24T19:56:18.727108 #18261]  INFO -- : worker=0 ready
                    I, [2014-10-24T19:56:18.742734 #18264]  INFO -- : worker=1 ready
                    I, [2014-10-24T19:56:18.921508 #8814]  INFO -- : reaped #<Process::Status:
                    pid 18246 exit 0> worker=0
                    I, [2014-10-24T19:56:18.921691 #8814]  INFO -- : reaped #<Process::Status:
                    pid 18249 exit 0> worker=1
                    I, [2014-10-24T19:56:18.921776 #8814]  INFO -- : master complete
                    
                    
                    Cheers!
                    Imdad Ali Khan
                    Mob (0) 9818484057
                    http://www.linkedin.com/in/imdad
                    
                    On 25 October 2014 01:11, Eric Wong <e@80x24.org> wrote:
                    
                    > <Imdad <khanimdad@gmail.com> wrote: > > INFO -- : executing ...>

                    message raw reply parent permalink

                      Re: Having issue with Unicorn
                      - by Eric Wong @ 10/24 - next/prev

                      So it looks like everything at 19:56 was successful and all is good,
                      right?

                      message raw reply parent permalink

                        Re: Having issue with Unicorn
                        - by Imdad @ 10/24 - next/prev

                        Nope, still its not working, same error as below
                        
                        Cheers!
                        Imdad Ali Khan
                        Mob (0) 9818484057
                        http://www.linkedin.com/in/imdad
                        
                        On 25 October 2014 01:36, Eric Wong <e@80x24.org> wrote:
                        
                        > So it looks like everything at 19:56 was successful and all is good,
                        > right?
                        >

                        message raw reply parent permalink

                          Re: Having issue with Unicorn
                          - by Eric Wong @ 10/24 - next/prev

                          Imdad <khanimdad@gmail.com> wrote:
                          > Nope, still its not working, same error as below
                          
                          I'm not sure what you mean...  Can you access the site OK?
                          
                          > <I, [2014-10-24T19:56:16.054817 #18256] INFO -- : executing > ...>
                          
                          Everything above looks OK.

                          message raw reply parent permalink

                            Re: Having issue with Unicorn
                            - by Imdad @ 10/24 - next/prev

                            Sorry Eric, but the site (http://104.131.74.69/) still not working
                            Showing error "We're sorry, but something went wrong."
                            
                            Cheers!
                            Imdad Ali Khan
                            Mob (0) 9818484057
                            http://www.linkedin.com/in/imdad
                            
                            On 25 October 2014 01:47, Eric Wong <e@80x24.org> wrote:
                            
                            > <Imdad <khanimdad@gmail.com> wrote: > > Nope, still its not ...>

                            message raw reply parent permalink

                              Re: Having issue with Unicorn
                              - by Imdad @ 10/24 - next/prev

                              The log file under "/var/www/hailisys/releases/shared" folder have the
                              following error logs
                              
                              root@Hailisys:/var/www/hailisys/releases/shared# tail -n 20 -f
                              log/unicorn.stderr.log
                              I, [2014-10-24T16:28:27.289186 #12384]  INFO -- : listening on addr=
                              0.0.0.0:3000 fd=10
                              F, [2014-10-24T16:28:27.289460 #12384] FATAL -- : error adding listener
                              addr=/var/www/hailisys/releases/shared/sockets/unicorn.sock
                              /var/www/hailisys/releases/17/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/socket_helper.rb:158:in
                              `initialize': No such file or directory - connect(2) for
                              "/var/www/hailisys/releases/shared/sockets/unicorn.sock" (Errno::ENOENT)
                              from
                              /var/www/hailisys/releases/17/vendor/bundle/ruby/2.1.0/gems/unicorn-4.8.3/lib/unicorn/socket_helper.rb:158:in
                              `new'
                              
                              
                              Cheers!
                              Imdad Ali Khan
                              Mob (0) 9818484057
                              http://www.linkedin.com/in/imdad
                              
                              On 25 October 2014 02:05, Imdad <khanimdad@gmail.com> wrote:
                              
                              > <Sorry Eric, but the site (http://104.131.74.69/) still not working > ...>

                              message raw reply parent permalink

                                Re: Having issue with Unicorn
                                - by Eric Wong @ 10/24 - next/prev

                                Imdad <khanimdad@gmail.com> wrote:
                                > The log file under "/var/www/hailisys/releases/shared" folder have the
                                > following error logs
                                > 
                                > root@Hailisys:/var/www/hailisys/releases/shared# tail -n 20 -f
                                > log/unicorn.stderr.log
                                > I, [2014-10-24T16:28:27.289186 #12384]  INFO -- : listening on addr=
                                > 0.0.0.0:3000 fd=10
                                > F, [2014-10-24T16:28:27.289460 #12384] FATAL -- : error adding listener
                                > addr=/var/www/hailisys/releases/shared/sockets/unicorn.sock
                                
                                Your successful deploy was at 19:56, so this failure is over 3 hours
                                before that.  I'm assuming all your deployment envs are UTC (as they
                                should be).

                                message raw reply parent permalink

                              Re: Having issue with Unicorn
                              - by Eric Wong @ 10/24 - next/prev

                              Imdad <khanimdad@gmail.com> wrote:
                              > Sorry Eric, but the site (http://104.131.74.69/) still not working
                              > Showing error "We're sorry, but something went wrong."
                              
                              I suspect that is a different error.  Anything else in your logs
                              (especially app logs).  Your unicorn stderr logs looked fine
                              after the deploy...

                              message raw reply parent permalink

                                Re: Having issue with Unicorn
                                - by Imdad @ 10/24 - next/prev

                                My app logs (shared/log/production.log) and /var/log/nginx/error.log both
                                are empty
                                
                                
                                Where else i can see the logs?
                                
                                Cheers!
                                Imdad Ali Khan
                                Mob (0) 9818484057
                                http://www.linkedin.com/in/imdad
                                
                                On 25 October 2014 02:10, Eric Wong <e@80x24.org> wrote:
                                
                                > Imdad <khanimdad@gmail.com> wrote:
                                > > Sorry Eric, but the site (http://104.131.74.69/) still not working
                                > > Showing error "We're sorry, but something went wrong."
                                >
                                > I suspect that is a different error.  Anything else in your logs
                                > (especially app logs).  Your unicorn stderr logs looked fine
                                > after the deploy...
                                >

                                message raw reply parent permalink

                                  Re: Having issue with Unicorn
                                  - by Imdad @ 10/24 - next/prev

                                  Yes it makes sense the following states that the deployment went well, but
                                  why do i still see error when i access the app (http://104.131.74.69/), and
                                  also this no error message in "shared/log/production.log" ,
                                  "/var/log/nginx/error.log"
                                  or "unicorn.stderr.log"
                                  
                                  I, [2014-10-24T19:55:54.851649 #18249]  INFO -- : worker=1 ready
                                  I, [2014-10-24T19:56:16.054817 #18256]  INFO -- : executing
                                  ["/var/www/hailisys/current/vendor/bundle/ruby/2.1.0/bin/unicorn", "-c",
                                  "/var/www/hailisys/current/config/unicorn.rb", "-D", "-E", "production",
                                  {11=>#<Kgio::UNIXServer:fd 11>}] (in /var/www/hailisys/releases/31)
                                  I, [2014-10-24T19:56:16.626199 #18256]  INFO -- : inherited
                                  addr=/var/www/hailisys/shared/sockets/unicorn.sock fd=11
                                  
                                  
                                  Cheers!
                                  Imdad Ali Khan
                                  Mob (0) 9818484057
                                  http://www.linkedin.com/in/imdad
                                  
                                  On 25 October 2014 02:15, Imdad <khanimdad@gmail.com> wrote:
                                  
                                  > <My app logs (shared/log/production.log) and /var/log/nginx/error.log ...>

                                  message raw reply parent permalink

                                  Re: Having issue with Unicorn
                                  - by Eric Wong @ 10/24 - next/prev

                                  Imdad <khanimdad@gmail.com> wrote:
                                  > My app logs (shared/log/production.log) and /var/log/nginx/error.log both
                                  > are empty
                                  
                                  I'm not up-to-date on Rails logging these days (see Rails docs if nobody
                                  else answers), but for nginx, you can use this to increase verbosity:
                                  
                                  	error_log /path/to/nginx/error.log debug
                                  
                                  ref: http://nginx.org/en/docs/ngx_core_module.html#error_log
                                  
                                  In unicorn, you can also bypass nginx for debugging purposes by
                                  setting up another listener on any port you want:
                                  
                                  	listen 12345

                                  message raw reply parent permalink

                                    Re: Having issue with Unicorn
                                    - by Imdad @ 10/24 - next/prev

                                    Thanks Eric, will look into this issue.
                                    
                                    Much appreciated if you could forward this issue to someone who can help
                                    here.
                                    
                                    Thanks again for your cooperation.
                                    
                                    Cheers!
                                    Imdad Ali Khan
                                    Mob (0) 9818484057
                                    http://www.linkedin.com/in/imdad
                                    
                                    On 25 October 2014 02:28, Eric Wong <e@80x24.org> wrote:
                                    
                                    > <Imdad <khanimdad@gmail.com> wrote: > > My app logs ...>

                                    message raw reply parent permalink

Re: dropping Ruby 1.8 support for unicorn 5?
- by Eric Wong @ 10/18 - next/prev

On a related note, I hope nobody is still on Ruby 1.9.1 or (shudder)
1.9.0.

I'd like to use require_relative; a 1.9.2+ feature and 1.9.2 is already
EOL these days.  I think there's still many 1.9.3 users out there, so we
need to continue supporting that for a while.

message raw reply parent permalink

Re: Reserved workers not as webservers
- by Bráulio Bhavamitra @ 10/13 - next/prev

I'm pretty happy to say this daemons setup is working beautifully on
three production rails apps (10 workers each). It is really nice to
have one pid/master process for the entire app, to know unicorn master
restarts the daemons if they crash (which sometimes happens with
delayed_job), and to restart the app and daemons all by once (with
USR2 signal), and fast!

Thanks Eric and other unicorn developers!

cheers,
bráulio

On Sat, Oct 11, 2014 at 12:35 AM, Bráulio Bhavamitra
<braulio@eita.org.br> wrote:
> <On Thu, Oct 9, 2014 at 3:15 PM, Eric Wong <e@80x24.org> wrote: ...>

message raw reply parent permalink


page: next      atom permalink
- unicorn Rack HTTP server user/dev discussion
A public-inbox, anybody may post in plain-text (not HTML):
unicorn-public@bogomips.org
git URL for ssoma: git://bogomips.org/unicorn-public.git
homepage: http://unicorn.bogomips.org/
subscription optional: unicorn-public+subscribe@bogomips.org