Errno::EIO: Input/output error - <STDOUT>

扶醉桌前 提交于 2020-01-13 08:15:02

问题


class FaxFetchWorker
  include Sidekiq::Worker
  sidekiq_options :retry => false

  def perform(job_id=0)
    logger.warn "perform is invoked."

    FaxSource.all.each do |source|
      ...
    end
  end
end

Getting Error Errno::EIO: Input/output error - <STDOUT> on Line # 6


回答1:


The #6 line in your code is this

    logger.warn "perform is invoked."

This code needs opened STDOUT stream and your error name is Errno::EIO.

In linux EIO means, that there was made an attempt to read/write to stream which is currently unavailable. This could happen because of physical error or when orphaned process (whose parent has died) attempts to get stdio from parent process, or when stream is closed.




回答2:


The workers could be still running in the background but no longer have the access to STDOUT.

I.e. Those workers still keep processing jobs but when it comes to print, they complain about the EIO.

(In my case, it was caused by killing the tmux server WITHOUT killing the workers. Do a ps -ef | grep resque and there they are.)

Solution:

Kill those workers and start new ones.

e.g. pkill resque-1.25.2 (Or whatever the workers' name)




回答3:


For me restarting redis solved it: service redis restart



来源:https://stackoverflow.com/questions/23820469/errnoeio-input-output-error-stdout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!