Rails Input/output Error - Stdout
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more errno::eio: input/output error about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Input/output Error @ Io_write - Sinatra
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping errno::eio: input/output error @ io_fillbuf each other. Join them; it only takes a minute: Sign up Errno::EIO: Input/output error - up vote 3 down vote favorite 1 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 - on Line # 6 ruby-on-rails ruby-on-rails-3 sidekiq share|improve this question edited May 10 '15 at 1:51 hello_there_andy 1,169837 asked May 23 '14 at 3:21 Dipak Panchal 4,24121852 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted 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. share|improve this answer edited Jan 14 at 7:33 answered May 23 '14 at 7:31 media-slave24 966 add a comment| up vote 0 down vote 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) share|improve this answer answered Jan 11 at 23:45 Hahn 11125 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged ruby-on-rails ruby-on-rails-3 sidekiq or as
Sign in Pricing Blog Support Search GitHub This repository Watch 10 Star 226 Fork 161 sshingler/capistrano-resque Code Issues 5 Pull requests 3 Projects 0 Pulse Graphs New issue INFO -- : Failed to start worker : #> #81 Closed CharlesP opened this Issue Apr 9, 2014 · 4 comments Labels None yet Milestone No milestone Assignees No one assigned 3 participants CharlesP commented Apr 9, 2014 Has anyone seen the issue... At startup all my http://stackoverflow.com/questions/23820469/errnoeio-input-output-error-stdout workings are immediately exiting. In the log file I am getting the following output: INFO -- : Failed to start worker : #> TylerRick commented Apr 14, 2014 This same error (Errno::EIO: Input/output error - ) happened for me, but it wasn't when it was trying to start the worker; it was while the worker was processing a job. https://github.com/sshingler/capistrano-resque/issues/81 Apparently writing any output at all to $stderr from a resque worker/job is enough to cause this error for us in our production Rails environment. (We started seeing this error after upgrading Rails, because it tried to print this deprecation notice to $stderr: $stderr.puts "[deprecated] I18n.enforce_available_locales will default to true in the future. ) Our solution (which seemed to work) was to redirect the output (stdout and stderr) when starting up the worker process. Maybe the same solution could work for you too? I'll submit a pull request shortly. (See also #65) TylerRick referenced this issue Apr 14, 2014 Merged Add :resque_redirection option #82 CharlesP commented Apr 15, 2014 @TylerRick Thanks a lot for looking into this. It does seem to be related to attempting to write to stdout. I attempted to merge the code from #65 into the latest version here CharlesP@d5569f9 Unfortunately, after testing the deploy/restart process I'm still seeing this issue. Is this what you had in mind for writing the output from resque:work to >> resque.log? Collaborator dmarkow commented Apr
Sign in Pricing Blog Support Search GitHub This repository Watch 223 Star 6,779 Fork https://github.com/mperham/sidekiq/issues/1039 1,194 mperham/sidekiq Code Issues 5 Pull requests 0 Projects 0 https://robots.thoughtbot.com/input-output-redirection-in-the-shell Wiki Pulse Graphs New issue Input/output error - #1039 Closed geekontheway opened this Issue Jul 2, 2013 · 6 comments Labels None yet Milestone No milestone Assignees No one assigned 5 participants geekontheway commented Jul 2, 2013 input/output error Hi all, when sending request via xml format using sidekiq as background job. we come across Input/output error. Input/output error - /home/rails/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/logger.rb:574:in `write' is it a sidekiq problem or a logger problem? related sidekiq worker code sample like this. client = Savon.client(wsdl: wsdl_client) # this line fires. response = errno::eio: input/output error client.call(:so_to_wms, message:{xml: xml}) result_xml = response.body[:so_to_wms_response][:out] result = Hash.from_xml(result_xml).as_json Owner mperham commented Jul 2, 2013 This error indicates you're starting Sidekiq incorrectly so that its stdout/stdin/stderr streams are invalid. mperham closed this Jul 21, 2013 ijak commented Aug 27, 2014 //This error indicates you're starting Sidekiq incorrectly so that its stdout/stdin/stderr streams are invalid.// Hi mperham, We encountered the same problem while reading a file from a worker. We start sidekiq using "bundle exec sidekiq -C config/sidekiq.yml". We have the following inside sidekiq.yml : --- :concurrency: 3 :pidfile: tmp/pids/sidekiq.pid :logfile: ./log/sidekiq.log staging: :concurrency: 10 production: :concurrency: 20 :queues: - default - [queue1, 2] - [queue2, 2] - [queue3, 2] - [queue4, 1] - [queue5, 2] - [queue6, 2] - [queue7, 2] - [queue8, 2] - [queue9, 2] How to avoid this "Input/output error - " in worker? Thanks. manuelmeurer commented Nov 19, 2014 @geekontheway @ijak I also started seeing th
we can see, echo hello is a command that means “output hello”. But where does that output really go? Standard output Every Unix-based operating system has a concept of “a default place for output to go”. Since that phrase is a mouthful, everyone calls it “standard output”, or “stdout”, pronounced standard out. Your shell (probably bash or zsh) is constantly watching that default output place. When your shell sees new output there, it prints it out on the screen so that you, the human, can see it. Otherwise echo hello would send “hello” to that default place and it would stay there forever. Standard input Standard input (“stdin”, pronounced standard in) is the default place where commands listen for information. For example, if you type cat with no arguments, it listens for input on stdin, outputting what you type to stdout, until you send it an EOF character (CTRL+d): $ cat
hello there
hello there
say it again
say it again
[ctrl+d]
As you can see, with standard input, you can send a string to a command directly. Pipes Pipes connect the standard output of one command to the standard input of another. You do this by separating the two commands with the pipe symbol (|). Here’s an example: $ echo "hello there"
hello there
$ echo "hello there" | sed "s/hello/hi/"
hi there
echo "hello there" prints hello there to stdout. But when we pipe it to sed "s/hello/hi/", sed takes that output as its input and replaces “hello” with “hi”, then prints out that result to stdout. Your shell only sees the final result after it’s been processed by sed, and prints that result to the screen. Hey, if sed sends its result to standard out, can we pipe sed to another sed? Yep! $ echo "hello there" | sed "s/hello/hi/" | sed "s/there/robots/"
hi robots
Above, we’ve connected echo to sed, then connected that to another sed. Pipes are great for taking output of one command and transforming it using other commands like jq. They’re a key part of the Unix philosophy of “small sharp tools”: since commands can be chained together with pipes, each command only needs to do one thing and then hand it off to another command. Standard error Standard error (“stderr”) is like standard output and standard input,