问题描述
我正在尝试从Heroku迁移到AWS,但是我的Sidekiq作业始终失败,并出现以下错误:
I am attempting to migrate from Heroku to AWS, but my Sidekiq jobs keep failing with the following error:
Errno::EPIPE: Broken pipe @ io_write - <STDOUT>
我可以使用perform_now
从控制台成功运行作业,并且一切在Heroku中都可以正常工作,因此我推测问题出在我的AWS设置中.我已经看到有关Stack Overflow和Github的不正确守护进程的引用,但不确定如何解决该问题.
I can successfully run jobs from the console using perform_now
, and everything works just fine in Heroku, so I am presuming the issue lies somewhere with my AWS setup. I have seen references to improper daemonization around Stack Overflow and Github but not sure how to solve the problem.
现在,我使用以下命令启动进程:
Right now I am launching my processes with the following command:
foreman start -f Procfile -p 3000 -e $VAR_FILES &
,并且我已经尝试在最后加上和不加上&
的命令.
and I have tried the command both with and without the &
at the end.
我的Procfile看起来像这样:
My Procfile looks like this:
web: bundle exec puma -t 1:2 -p ${PORT:-3000} -e ${RACK_ENV:-production}worker: bundle exec sidekiq -C config/sidekiq.ymllog: tail -f log/production.log
web: bundle exec puma -t 1:2 -p ${PORT:-3000} -e ${RACK_ENV:-production}worker: bundle exec sidekiq -C config/sidekiq.ymllog: tail -f log/production.log
,我也按照此处的说明进行了这样的尝试( https://github.com/mperham/sidekiq/wiki/Logging#syslog ):
and I have also tried it like this, following the instructions here (https://github.com/mperham/sidekiq/wiki/Logging#syslog):
worker: bundle exec sidekiq -C config/sidekiq.yml 2>&1 | logger -t sidekiq
我的sidekiq.yml
将logfile
设置为./log/sidekiq.log
,我认为应该将日志从STDOUT重定向出去.
My sidekiq.yml
has logfile
set to ./log/sidekiq.log
, which I believe is supposed to redirecting logs away from STDOUT anyway.
我在这里看到了讨论( https://github.com/mperham/sidekiq/Issues/3188 ),并可以验证rails12factor
gem不在我的Gemfile中.
I have seen the discussion here (https://github.com/mperham/sidekiq/issues/3188) and can verify that the rails12factor
gem is not in my Gemfile.
但是错误仍然存在...任何人都可以伸出援手吗?
But still the error persists... Can anyone lend a hand?
更新:我终于可以得到堆栈跟踪,并看到它来自Neo4j.rb gem内部的puts
语句:
UPDATE: I can finally get a stack trace and see it is coming from a puts
statement inside of the Neo4j.rb gem:
2017-04-07T15:46:53.553Z 697 TID-12a6r4 WARN: Errno::EPIPE: Broken pipe @ io_write - <STDOUT>2017-04-07T15:46:53.553Z 697 TID-12a6r4 WARN: /var/lib/gems/2.3.0/bundler/gems/neo4j-c804cb33bef8/lib/neo4j/session_manager.rb:60:in `write'/var/lib/gems/2.3.0/bundler/gems/neo4j-c804cb33bef8/lib/neo4j/session_manager.rb:60:in `puts'/var/lib/gems/2.3.0/bundler/gems/neo4j-c804cb33bef8/lib/neo4j/session_manager.rb:60:in `puts'
2017-04-07T15:46:53.553Z 697 TID-12a6r4 WARN: Errno::EPIPE: Broken pipe @ io_write - <STDOUT>2017-04-07T15:46:53.553Z 697 TID-12a6r4 WARN: /var/lib/gems/2.3.0/bundler/gems/neo4j-c804cb33bef8/lib/neo4j/session_manager.rb:60:in `write'/var/lib/gems/2.3.0/bundler/gems/neo4j-c804cb33bef8/lib/neo4j/session_manager.rb:60:in `puts'/var/lib/gems/2.3.0/bundler/gems/neo4j-c804cb33bef8/lib/neo4j/session_manager.rb:60:in `puts'
但仍然不确定如何解决该问题.我已经尝试过RAILS_LOG_TO_STDOUT=enabled
设置和取消设置.
But still not sure how I can mitigate the issue. I have tried with RAILS_LOG_TO_STDOUT=enabled
both set and unset.
推荐答案
我与gem维护人员交谈,他们删除了v 8.0.13
中的puts语句.它为我解决了问题!
I spoke to the gem maintainers and they removed the puts statements in v 8.0.13
. It fixed the problem for me!
这篇关于Sidekiq管道破裂错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!