ruby - Cannot Start Unicorn -


i wanted restart unicorn check out edits did locally on views.

i able stop unicorn. reason not restart.

here error giving me:

executing /etc/rc.d/init.d/unicorn_loadmax start ..  /etc/rc.d/init.d/unicorn_loadmax: line 20: kill: (24317) - no such process master failed start, check stderr log details 

here unicorn script

#!/bin/sh set -e # example init script, can used nginx, too, # since nginx , unicorn accept same signals  # feel free change of following variables app: timeout=${timeout-60} app_root=/home/deployer/loadmax/current pid=/home/deployer/loadmax/shared/pids/unicorn.pid cmd="cd /home/deployer/loadmax/current && bundle exec /home/deployer/loadmax/shared/bundle/ruby/1.9.1/bin/unicorn -d -c /home/deployer/loadmax/shared/config/unicorn.rb -e production" as_user=deployer action="$1" set -u  old_pid="$pid.oldbin"  cd $app_root || exit 1  sig () {         test -s "$pid" && kill -$1 `cat $pid` }  oldsig () {         test -s $old_pid && kill -$1 `cat $old_pid` }  case $action in start)         sig 0 && echo >&2 "already running" && exit 0         su -c "$cmd" - $as_user         ;; stop)         sig quit && exit 0         echo >&2 "not running"         ;; force-stop)         sig term && exit 0         echo >&2 "not running"         ;; restart|reload)         sig usr2 && echo reloaded ok && exit 0         echo >&2 "couldn't reload, starting '$cmd' instead"         su -c "$cmd" - $as_user         ;; upgrade)         if sig usr2 && sleep 2 && sig 0 && oldsig quit                         n=$timeout                 while test -s $old_pid && test $n -ge 0                                         printf '.' && sleep 1 && n=$(( $n - 1 ))                 done                 echo                  if test $n -lt 0 && test -s $old_pid                                         echo >&2 "$old_pid still exists after $timeout seconds"                         exit 1                 fi                 exit 0         fi         echo >&2 "couldn't upgrade, starting '$cmd' instead"         su -c "$cmd" - $as_user         ;; reopen-logs)         sig usr1         ;; *)         echo >&2 "usage: $0 <start|stop|restart|upgrade|force-stop|reopen-logs>"         exit 1         ;; esac 

log file:

i, [2014-03-24t15:25:07.830877 #13704]  info -- : refreshing gem list         security warning: no secret option provided rack::session::cookie.         poses security threat. recommended         provide secret prevent exploits may possible crafted         cookies. not supported in future versions of rack, ,         future versions invalidate existing user cookies.          called from: /home/deployer/website/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.  /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require': /home/deployer/website/releases/20140111043133/app/models/document.rb:26: syntax error, unexpected tconstant, expecting keyword_end (syntaxerror)     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:359:in `require_or_load'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:502:in `load_missing_constant'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:192:in `block in const_missing'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `each'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:190:in `const_missing'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:229:in `block in constantize'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `each'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:228:in `constantize'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/inflector/methods.rb:259:in `safe_constantize'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/core_ext/string/inflections.rb:66:in `safe_constantize'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/params_wrapper.rb:152:in `_default_wrap_model'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/params_wrapper.rb:169:in `_set_wrapper_defaults'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/metal/params_wrapper.rb:133:in `inherited'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.3/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'     /home/deployer/website/releases/20140111043133/app/controllers/documents_controller.rb:1:in `<top (required)>'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:359:in `require_or_load'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:313:in `depend_on'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:225:in `require_dependency'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:438:in `each'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:438:in `block in eager_load!'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:436:in `each'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:436:in `eager_load!'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application/finisher.rb:53:in `block in <module:finisher>'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'     /home/deployer/website/releases/20140111043133/config/environment.rb:5:in `<top (required)>'     config.ru:4:in `require'     config.ru:4:in `block in <main>'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'     config.ru:1:in `new'     config.ru:1:in `<main>'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `eval'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn.rb:44:in `block in builder'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `call'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:722:in `build_app!'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:140:in `start'     /home/deployer/website/shared/bundle/ruby/1.9.1/gems/unicorn-4.6.2/bin/unicorn:126:in `<top (required)>'     /home/deployer/website/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'     /home/deployer/website/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>' 

document.rb

class document < activerecord::base   attr_accessible :description, :filename, :filesize, :filetype, :name, :user_id   belongs_to :user    filename_format = /^[a-za-z0-9_\.]+$/   bad_filetype_format = /^badfiletype$/   mime_hash = { "doc" => "application/msword",                 "docx" => "application/msword",                 "dot" => "application/msword",                 "xml" => "application/xml",                 "pdf" => "application/pdf",                 "tif" => "image/tif",                 "txt" => "text/plain",                 "xls" => "application/vnd.ms-excel",                 "xlsx" => "application/vnd.ms-excel",                 "ppt" => "application/vnd.ms-powerpoint",                 "pptx" => "application/vnd.ms-powerpoint",                 "gif" => "image/gif",                 "png" => "image/png",                 "jpg" => "image/jpg",                 "jpeg" => "image/jpg",                 "ps" => "application/postscript",                 "rtf" => "application/rtf",                 "zip" => "application/zip" }    validates_numericality_of :filesize, less_than: 50m   validates_format_of :filename, with: filename_format   validates_format_of :filetype, without: bad_filetype_format end 

i did change line 26 yesterday...

changed 2048 50m

your script crashes on following line:

test -s "$pid" && kill -$1 `cat $pid` 

$pid set in:

pid=/home/deployer/loadmax/shared/pids/unicorn.pid 

and test -s checks file exists, , has size larger zero.

try deleting file, running script again.


as line 26 - try removing m - not number... - put 50


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -