错误 - :获取#< Process :: Status:pid 4335 exit 1>工人= 0 [英] ERROR -- : reaped #<Process::Status: pid 4335 exit 1> worker=0

查看:194
本文介绍了错误 - :获取#< Process :: Status:pid 4335 exit 1>工人= 0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用:ruby(1.9.3-rc1),rails,capistrano,nginx和unicorn在我的vps(Ubuntu 12.04 Server(64位))上部署。



我还遵循Ryan Bates的railsscast教程,显示如何从零开始部署VPS。



实现上限部署:冷命令似乎工作正常(作为所有其他人),但是当我尝试继续我的网址时,我落在我们很抱歉,但有些事情走向=>从Rails的默认错误页。



在我的生产日志中我得到:

 迁移到CreateQuestionAnswers(20130317152603)
迁移到创建区域(20130502212531)
迁移到AddRegionIdToSection(20130502212557)
迁移到CreateAnnonceImages(20130510130906)
迁移到AddAttachmentImageToAnnonceImages(20130510130925)
迁移到CreateFormations(20130510195503)
迁移到CreateInscriptions(20130510195627)
迁移到AddAttachmentImageToFormations(20130511182928)
迁移到AddParamsToInscription(20130514231201)
迁移到AddPaypalidToInscription(20130514234243)
(0.3ms)SELECTschema_migrations。versionFROMschema_migrations
连接到database.yml指定的数据库
连接到database.yml指定的数据库
创建范围:全部。覆盖现有方法User.all。
创建范围:全部。覆盖现有方法User.all。
创建范围:全部。覆盖现有方法Echange.all。
创建范围:全部。覆盖现有方法Echange.all。
创建范围:验证。覆盖现有方法Annonce.validate。
创建范围:验证。覆盖现有方法Annonce.validate。
创建范围:全部。覆盖现有方法Article.all。
创建范围:全部。覆盖现有方法Article.all。

所以我看着我的独角兽日志,我发现这个:

  E,[2013-05-21T03:20:08.751341#31081] ERROR  - :reaped#< Process :: Status:pid 4335 exit 1>工人= 0 
我,[2013-05-21T03:20:08.753997#31081] INFO - :worker = 0产卵...
E,[2013-05-21T03:20:08.790666# 31081] ERROR - :reaped#< Process :: Status:pid 4332 exit 1>工人= 1
我,[2013-05-21T03:20:08.791251#31081] INFO - :worker = 1产卵...
I,[2013-05-21T03:20:08.794600# 4341]信息 - :worker = 0产生pid = 4341
我,[2013-05-21T03:20:08.796302#4341]信息 - :刷新宝石列表
I,[2013-05- 21T03:20:08.802089#4344]信息 - :worker = 1产生pid = 4344
我,[2013-05-21T03:20:08.803227#4344] INFO - :刷新宝石列表
I ,[2013-05-21T03:20:37.871677#31081] INFO - :重新加载config_file = / home / deployer / apps / avocat-immo / current / config / unicorn.rb
I,[2013-05- 21T03:20:37.876045#31081] INFO - :完成重新加载config_file = / home / deployer / apps / avocat-immo / current / config / unicorn.rb
我,[2013-05-21T03:20:38.002451 #31081] INFO - :reaped#< Process :: Status:pid 4344 exit 0>工人= 1
我,[2013-05-21T03:20:38.002640#31081] INFO - :worker = 1产卵...
I,[2013-05-21T03:20:38.007280# 4674] INFO - :worker = 1产生pid = 4674
I,[2013-05-21T03:20:38.007595#4674] INFO - :刷新宝石列表
I,[2013-05- 21T03:20:38.010511#31081] INFO - :reaped#< Process :: Status:pid 4341 exit 0> worker = 0
我,[2013-05-21T03:20:38.010714#31081] INFO - :worker = 0产卵...
我,[2013-05-21T03:20:38.012600# 4678] INFO - :worker = 0产生pid = 4678
I,[2013-05-21T03:20:38.012886#4678]信息 - :刷新宝石列表
I,[2013-05- 21T03:21:08.079364#4678] INFO - :worker = 0 ready
I,[2013-05-21T03:21:08.080779#4674] INFO - :worker = 1 ready
I, 2013-05-21T03:21:46.897404#31081] INFO - :重新加载config_file = / home / deployer / apps / avocat-immo / current / config / unicorn.rb
我,[2013-05-21T03: 21:46.900599#31081] INFO - :完成重新加载config_file = / home / deployer / apps / avocat-immo / current / config / unicorn.rb
我,[2013-05-21T03:21:47.237973#31081 ] INFO - :reaped#< Process :: Status:pid 4678 exit 0> worker = 0
I,[2013-05-21T03:21:47.238160#31081] INFO - :worker = 0产卵...
我,[2013-05-21T03:21:47.241018# 31081] INFO - :reaped#< Process :: Status:pid 4674 exit 0>工人= 1
我,[2013-05-21T03:21:47.241296#31081] INFO - :worker = 1产卵...
I,[2013-05-21T03:21:47.243055# 4919] INFO - :worker = 0 spawned pid = 4919
I,[2013-05-21T03:21:47.243287#4919] INFO - :刷新宝石列表
I,[2013-05- 21T03:21:47.245830#4921]信息 - :工人= 1生成pid = 4921
我,[2013-05-21T03:21:47.246122#4921]信息 - :刷新宝石列表
I ,[2013-05-21T03:22:17.055549#4919] INFO - :worker = 1 ready
I,[2013-05-21T03:22:17.057331#4921] INFO - :worker = 1 ready
我,[2013-05-21T03:29:57.149534#31081] INFO - :重新加载config_file = / home / deployer / apps / avocat-immo / current / config / unicorn.rb
I, 2013-05-21T03:29:57.181644#31081] INFO - :完成重新加载config_file = / home / deployer / apps / avocat-immo / current / config / unicorn.rb
我,[2013-05-21T03 :29:57.997267#31081] INFO - :reaped#< Process :: Status:pid 4919 exit 0> worker = 0
我,[2013-05-21T03:29:57.997689#31081] INFO - :worker = 0产卵...
我,[2013-05-21T03:29:58.003458# 31081] INFO - :reaped#< Process :: Status:pid 4921 exit 0>工人= 1
我,[2013-05-21T03:29:58.003691#31081] INFO - :worker = 1产卵...
I,[2013-05-21T03:29:58.010269# 7783] INFO - :worker = 0产生pid = 7783

一遍又一遍...

所以这里是我的配置:



我的unicorn.rb:

  root =/ home / deployer / apps / avocat-immo / current
working_directory root
pid#{root} / tmp / pids / unicorn.pid
stderr_path#{root} /log/unicorn.log
stdout_path#{root} /log/unicorn.log
listen/tmp/unicorn.avocat .sock
worker_processes 2
超时30

这里是我的unicorn_init。 sh

 #!/ bin / sh 
set -e

#随意更改您的应用程序的以下任何变量:
TIMEOUT = $ {TIMEOUT-60}
APP_ROOT = / home / deployer / apps / avocat-immo / current
PID = $ APP_ROOT / tmp /pids/unicorn.pid
CMD =cd $ APP_ROOT; bundle exec unicorn -D -c $ APP_ROOT / config / unicorn.rb -E prod uction
AS_USER = deployer
set -u

OLD_PIN =$ PID.oldbin

sig(){
test - s$ PID&& kill - $ 1`cat $ PID`
}

oldsig(){
test -s $ OLD_PIN&&杀死 - $ 1`cat $ OLD_PIN`
}

run(){
if [$(id -un)=$ AS_USER];那么
eval $ 1
else
su -c$ 1 - $ AS_USER
fi
}

$ b $ $ b start)
sig 0&&& echo>& 2已经运行&&退出0
运行$ CMD
;;
stop)
sig QUIT&&&退出0
echo>& 2不运行
;;
force-stop)
sig TERM&&退出0
echo>& 2不运行
;;
restart | reload)
sig HUP&&&回音重新加载OK&&退出0
echo>& 2无法重新加载,'$ CMD'替代为'
run$ CMD
;;
升级)
如果sig USR2&&&睡2&& sig 0&&& oldsig QUIT
then
n = $ TIMEOUT
while test -s $ OLD_PIN&&&测试$ n -ge 0
do
printf'。&&&睡眠1&& n = $(($ n - 1))
done
echo

如果测试$ n -lt 0&&测试-s $ OLD_PIN
然后
echo>& 2$ OLD_PIN在$ TIMEOUT秒后仍然存在
exit 1
fi
exit 0
fi
echo>& 2无法升级,'$ CMD'代替'
运行$ CMD
;;
reopen-logs)
sig USR1
;;
*)
echo>& 2用法:$ 0< start | stop | restart | upgrade | force-stop | reopen-logs>
exit 1
;;
esac

我尝试过

  /etc/init.d/unicorn_avocat-immo start 
/etc/init.d/unicorn_avocat-immo stop

我也重新启动了nginx,但似乎没有任何工作。该网站在错误页面上以不到一秒的速度加载网站,并且网站尚未运行,因为它应该在生产中。



任何人都可以帮助我吗? / p>

在nginx errors.log中找到的其他信息

  2013/05/21 12:23:08 [crit] 19097#0:* 16 connect()到unix:/tmp/avocat.sock失败(2:没有这样的文件或目录)连接到上游,客户端:**。***。**。***,server:请求:GET / HTTP / 1.1,上游:http:// unix:/tmp/avocat.sock:/,host: **。***。**。***


解决方案

只需在config / production.rb中添加 config.log_level =:debug



您将收到错误日志在log / production.log
粘贴该日志的输出,以便我可以帮助您



还尝试 rake assets:预编译


I am trying since 2 days to deploy on my vps (Ubuntu 12.04 Server (64 bits)) using : ruby (1.9.3-rc1), rails, capistrano, nginx and unicorn.

I also follow railscast tutorial from Ryan Bates showing how to deploy on VPS from scratch.

Actualy the cap deploy:cold command seems to work fine (as all the others) but when i try to go on my url i fall on "We're sorry but something went wront" => The default error page from Rails.

In my production logs i get :

Migrating to CreateQuestionAnswers (20130317152603)
Migrating to CreateRegions (20130502212531)
Migrating to AddRegionIdToSection (20130502212557)
Migrating to CreateAnnonceImages (20130510130906)
Migrating to AddAttachmentImageToAnnonceImages (20130510130925)
Migrating to CreateFormations (20130510195503)
Migrating to CreateInscriptions (20130510195627)
Migrating to AddAttachmentImageToFormations (20130511182928)
Migrating to AddParamsToInscription (20130514231201)
Migrating to AddPaypalidToInscription (20130514234243)
   (0.3ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" 
Connecting to database specified by database.yml
Connecting to database specified by database.yml
Creating scope :all. Overwriting existing method User.all.
Creating scope :all. Overwriting existing method User.all.
Creating scope :all. Overwriting existing method Echange.all.
Creating scope :all. Overwriting existing method Echange.all.
Creating scope :validate. Overwriting existing method Annonce.validate.
Creating scope :validate. Overwriting existing method Annonce.validate.
Creating scope :all. Overwriting existing method Article.all.
Creating scope :all. Overwriting existing method Article.all.

So i looked at my unicorn logs and i found this :

E, [2013-05-21T03:20:08.751341 #31081] ERROR -- : reaped #<Process::Status: pid 4335 exit         1> worker=0
I, [2013-05-21T03:20:08.753997 #31081]  INFO -- : worker=0 spawning...
E, [2013-05-21T03:20:08.790666 #31081] ERROR -- : reaped #<Process::Status: pid 4332 exit 1> worker=1
I, [2013-05-21T03:20:08.791251 #31081]  INFO -- : worker=1 spawning...
I, [2013-05-21T03:20:08.794600 #4341]  INFO -- : worker=0 spawned pid=4341
I, [2013-05-21T03:20:08.796302 #4341]  INFO -- : Refreshing Gem list
I, [2013-05-21T03:20:08.802089 #4344]  INFO -- : worker=1 spawned pid=4344
I, [2013-05-21T03:20:08.803227 #4344]  INFO -- : Refreshing Gem list
I, [2013-05-21T03:20:37.871677 #31081]  INFO -- : reloading config_file=/home/deployer/apps/avocat-immo/current/config/unicorn.rb
I, [2013-05-21T03:20:37.876045 #31081]  INFO -- : done reloading config_file=/home/deployer/apps/avocat-immo/current/config/unicorn.rb
I, [2013-05-21T03:20:38.002451 #31081]  INFO -- : reaped #<Process::Status: pid 4344 exit 0> worker=1
I, [2013-05-21T03:20:38.002640 #31081]  INFO -- : worker=1 spawning...
I, [2013-05-21T03:20:38.007280 #4674]  INFO -- : worker=1 spawned pid=4674
I, [2013-05-21T03:20:38.007595 #4674]  INFO -- : Refreshing Gem list
I, [2013-05-21T03:20:38.010511 #31081]  INFO -- : reaped #<Process::Status: pid 4341 exit 0> worker=0
I, [2013-05-21T03:20:38.010714 #31081]  INFO -- : worker=0 spawning...
I, [2013-05-21T03:20:38.012600 #4678]  INFO -- : worker=0 spawned pid=4678
I, [2013-05-21T03:20:38.012886 #4678]  INFO -- : Refreshing Gem list
I, [2013-05-21T03:21:08.079364 #4678]  INFO -- : worker=0 ready
I, [2013-05-21T03:21:08.080779 #4674]  INFO -- : worker=1 ready
I, [2013-05-21T03:21:46.897404 #31081]  INFO -- : reloading config_file=/home/deployer/apps/avocat-immo/current/config/unicorn.rb
I, [2013-05-21T03:21:46.900599 #31081]  INFO -- : done reloading config_file=/home/deployer/apps/avocat-immo/current/config/unicorn.rb
I, [2013-05-21T03:21:47.237973 #31081]  INFO -- : reaped #<Process::Status: pid 4678 exit 0> worker=0
I, [2013-05-21T03:21:47.238160 #31081]  INFO -- : worker=0 spawning...
I, [2013-05-21T03:21:47.241018 #31081]  INFO -- : reaped #<Process::Status: pid 4674 exit 0> worker=1
I, [2013-05-21T03:21:47.241296 #31081]  INFO -- : worker=1 spawning...
I, [2013-05-21T03:21:47.243055 #4919]  INFO -- : worker=0 spawned pid=4919
I, [2013-05-21T03:21:47.243287 #4919]  INFO -- : Refreshing Gem list
I, [2013-05-21T03:21:47.245830 #4921]  INFO -- : worker=1 spawned pid=4921
I, [2013-05-21T03:21:47.246122 #4921]  INFO -- : Refreshing Gem list
I, [2013-05-21T03:22:17.055549 #4919]  INFO -- : worker=0 ready
I, [2013-05-21T03:22:17.057331 #4921]  INFO -- : worker=1 ready
I, [2013-05-21T03:29:57.149534 #31081]  INFO -- : reloading config_file=/home/deployer/apps/avocat-immo/current/config/unicorn.rb
I, [2013-05-21T03:29:57.181644 #31081]  INFO -- : done reloading config_file=/home/deployer/apps/avocat-immo/current/config/unicorn.rb
I, [2013-05-21T03:29:57.997267 #31081]  INFO -- : reaped #<Process::Status: pid 4919 exit 0> worker=0
I, [2013-05-21T03:29:57.997689 #31081]  INFO -- : worker=0 spawning...
I, [2013-05-21T03:29:58.003458 #31081]  INFO -- : reaped #<Process::Status: pid 4921 exit 0> worker=1
I, [2013-05-21T03:29:58.003691 #31081]  INFO -- : worker=1 spawning...
I, [2013-05-21T03:29:58.010269 #7783]  INFO -- : worker=0 spawned pid=7783

Over and over ...

So here is my configs :

my unicorn.rb :

root = "/home/deployer/apps/avocat-immo/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
listen "/tmp/unicorn.avocat.sock"
worker_processes 2
timeout 30

And here is my unicorn_init.sh

#!/bin/sh
set -e

# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/deployer/apps/avocat-immo/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=deployer
set -u

OLD_PIN="$PID.oldbin"

sig () {
  test -s "$PID" && kill -$1 `cat $PID`
}

oldsig () {
  test -s $OLD_PIN && kill -$1 `cat $OLD_PIN`
}

run () {
  if [ "$(id -un)" = "$AS_USER" ]; then
    eval $1
  else
    su -c "$1" - $AS_USER
  fi
}

case "$1" in
start)
  sig 0 && echo >&2 "Already running" && exit 0
  run "$CMD"
  ;;
stop)
  sig QUIT && exit 0
  echo >&2 "Not running"
  ;;
force-stop)
  sig TERM && exit 0
  echo >&2 "Not running"
  ;;
restart|reload)
  sig HUP && echo reloaded OK && exit 0
  echo >&2 "Couldn't reload, starting '$CMD' instead"
  run "$CMD"
  ;;
upgrade)
  if sig USR2 && sleep 2 && sig 0 && oldsig QUIT
  then
n=$TIMEOUT
    while test -s $OLD_PIN && test $n -ge 0
    do
      printf '.' && sleep 1 && n=$(( $n - 1 ))
    done
    echo

    if test $n -lt 0 && test -s $OLD_PIN
    then
      echo >&2 "$OLD_PIN still exists after $TIMEOUT seconds"
      exit 1
    fi
    exit 0
  fi
  echo >&2 "Couldn't upgrade, starting '$CMD' instead"
  run "$CMD"
  ;;
reopen-logs)
  sig USR1
  ;;
*)
  echo >&2 "Usage: $0 <start|stop|restart|upgrade|force-stop|reopen-logs>"
  exit 1
  ;;
esac

I have tried

/etc/init.d/unicorn_avocat-immo start
/etc/init.d/unicorn_avocat-immo stop

I also restarted nginx but nothing seems to work. The website load in less then a sec on the error page and the website is not yet working as it should be in production.

Can anyone help me on that matter ?

Additional informations found in nginx errors.log

    2013/05/21 12:23:08 [crit] 19097#0: *16 connect() to unix:/tmp/avocat.sock failed (2: No such file or directory) while connecting to upstream, client: **.***.**.***, server: , request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/avocat.sock:/", host: "**.***.**.***"

解决方案

just add config.log_level = :debug in config/production.rb

you will get error log in log/production.log paste output of that log so i can help you

also try rake assets:precompile

这篇关于错误 - :获取#&lt; Process :: Status:pid 4335 exit 1&gt;工人= 0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆