hi. i''ve been trying to upgrade my stack to ruby 2.0 but keep getting this on ubuntu (not on my local os x): /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:746:in `for_fd'': Bad file descriptor (Errno::EBADF) from /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:746:in `block in inherit_listeners!'' from /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:745:in `map'' from /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:745:in `inherit_listeners!'' from /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:127:in `start'' from /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `<top (required)>'' this happens all the time for my legacy rails app, but i''m not able to reproduce on a tiny new rack app. i''m wondering if this could be related: https://github.com/puma/puma/issues/177 https://github.com/puma/puma/pull/220 any tips? --port _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
Port Himmerland <port.himmerland@icloud.com> wrote:> hi. i''ve been trying to upgrade my stack to ruby 2.0 but keep getting this on ubuntu (not on my local os x): > > /hello/shared/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:746:in `for_fd'': Bad file descriptor (Errno::EBADF) > > this happens all the time for my legacy rails app, but i''m not able to reproduce on a tiny new rack app. i''m wondering if this could be related: > > https://github.com/puma/puma/issues/177 > https://github.com/puma/puma/pull/220We''ve been prepared for close-on-exec by default since unicorn 4.1.0 over two years ago: commit 6ab27beeda3b0aaaa66f7cc4f734944a7aa84385 Author: Eric Wong <normalperson@yhbt.net> Date: Thu Aug 11 12:59:09 2011 -0700 future-proof against close-on-exec by default Did you upgrade to Ruby 2.0.0 before upgrading to unicorn 4.1+? _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
Eric Wong <normalperson <at> yhbt.net> writes:> Did you upgrade to Ruby 2.0.0 before upgrading to unicorn 4.1+?we''ve been running a unicorn 4.6.3 setup on ruby 1.9.3 for quite a while with no similar issues. i''ll keep digging through our lifecycle config to see if i can get closer to the cause. _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
port <port.himmerland@icloud.com> wrote:> Eric Wong <normalperson <at> yhbt.net> writes: > > > Did you upgrade to Ruby 2.0.0 before upgrading to unicorn 4.1+? > > we''ve been running a unicorn 4.6.3 setup on ruby 1.9.3 for quite a while > with no similar issues. i''ll keep digging through our lifecycle config > to see if i can get closer to the cause.OK, this is really strange; especially since you''re only hitting this on your legacy app and not a new one. I certainly haven''t hit this with Ruby 2.0.0 anywhere (neither unicorn nor Rainbows!). I''m fairly certain enough folks are using Ruby 2.0.0 by now that we would have more reports if something were amiss. Let us know what you find, thanks! _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
Eric Wong <normalperson <at> yhbt.net> writes:> OK, this is really strange; especially since you''re only hitting this > on your legacy app and not a new one. > > I certainly haven''t hit this with Ruby 2.0.0 anywhere (neither unicorn > nor Rainbows!). I''m fairly certain enough folks are using Ruby 2.0.0 by > now that we would have more reports if something were amiss. > > Let us know what you find, thanks!We ran into the same issue. For us, it was because we were executing the process using bundle exec. Bundler doesn''t preserve the 1.9 behavior around FD inheritance. https://github.com/bundler/bundler/issues/2628 _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
Eric Chapweske <eac@zendesk.com> wrote:> We ran into the same issue. For us, it was because we were executing the > process using bundle exec. Bundler doesn''t preserve the 1.9 behavior around > FD inheritance. https://github.com/bundler/bundler/issues/2628Thanks Eric! I just pushed out the following and updated the website. Subject: [PATCH] Sandbox: document SIGUSR2 + bundler issue with 2.0.0 Thanks to Eric Chapweske for the heads up. ref: http://mid.gmane.org/loom.20130904T205308-432@post.gmane.org --- Sandbox | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sandbox b/Sandbox index 1df149b..3c7f226 100644 --- a/Sandbox +++ b/Sandbox @@ -60,6 +60,13 @@ If you''re using an older Bundler version (0.9.x), you may need to set or reset GEM_HOME, GEM_PATH and PATH environment variables in the before_exec hook as illustrated by http://gist.github.com/534668 +=== Ruby 2.0.0 close-on-exec and SIGUSR2 incompatibility + +Ruby 2.0.0 enforces FD_CLOEXEC on file descriptors by default. unicorn +has been prepared for this behavior since unicorn 4.1.0, but we forgot +to remind the Bundler developers. This issue is being tracked here: +https://github.com/bundler/bundler/issues/2628 + == Isolate === Running -- Eric Wong _______________________________________________ Unicorn mailing list - mongrel-unicorn@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-unicorn Do not quote signatures (like this one) or top post when replying
Reasonably Related Threads
- Rack content-length Rack::Lint::LintErrors errors with unicorn
- [PATCH] Start the server if another user has a PID matching our stale pidfile.
- Unicorn 3.3.1 "Too many open files" error in kgio_tryaccept
- [PATCH] construct listener_fds Hash in 1.8 compatible way
- app error: Socket is not connected (Errno::ENOTCONN)