Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 595
Dipak Panchal Avatar asked May 23 '14 03:05

Dipak Panchal


2 Answers

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.

like image 169
media-slave24 Avatar answered Oct 26 '22 21:10

media-slave24


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)

like image 28
Hahn Avatar answered Oct 26 '22 23:10

Hahn