Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 131489 - ruby-fcgi-0.8.6 failing for file uploads from lighttpd (O_NONBLOCK)
Summary: ruby-fcgi-0.8.6 failing for file uploads from lighttpd (O_NONBLOCK)
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Ruby Team
URL: http://sean.treadway.info/articles/20...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-27 11:21 UTC by Eoin Curran
Modified: 2007-01-29 07:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to ruby-fcgi to disable non-blocking socket (ruby-fcgi-0.8.6-eagain.patch,692 bytes, patch)
2006-04-27 11:23 UTC, Eoin Curran
Details | Diff
ebuild of 0.8.6 with the patch (ruby-fcgi-0.8.6-r1.ebuild,583 bytes, text/plain)
2006-04-27 11:23 UTC, Eoin Curran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eoin Curran 2006-04-27 11:21:21 UTC
I was getting the problem described at
http://sean.treadway.info/articles/2005/12/24/open-season-for-eagain

and was able to fix it with the patch at that page.

Have an ebuild for this...
Comment 1 Eoin Curran 2006-04-27 11:23:08 UTC
Created attachment 85620 [details, diff]
Patch to ruby-fcgi to disable non-blocking socket
Comment 2 Eoin Curran 2006-04-27 11:23:39 UTC
Created attachment 85621 [details]
ebuild of 0.8.6 with the patch
Comment 3 Eoin Curran 2006-04-28 10:23:04 UTC
ooops.. this didn't completely fix the problem. For some reason, I did get two successful uploads after making the change, and then the problem re-appeared.

Seems to actually be a problem with combining apache https and ProxyPass to lighttpd. If I connect to lighttpd directly, the upload works fine. The problem only arises when I put apache https as a reverse proxy in front of it...

e.
Comment 4 Eoin Curran 2006-04-28 10:32:57 UTC
More info:

I changed /usr/lib/ruby/1.8/cgi.rb:981 to:
raise EOFError, "bad content body (CL=#{content_length}) '#{boundary}' != '#{status}'"

and I get:
[28/Apr/2006:17:08:15 :: 1804] Dispatcher failed to catch: bad content body (CL=83346) '-----------------------------25662295697298' != 'XXXXXXXX data from the middle of my file XXXXXXXX' (EOFError)
  /usr/lib/ruby/1.8/cgi.rb:981:in `read_multipart'
  /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/cgi_ext/raw_post_data_fix.rb:20:in `initialize_query'
  /usr/lib/ruby/1.8/cgi.rb:2270:in `initialize'
  (eval):16:in `initialize'
  /usr/lib/ruby/site_ruby/1.8/fcgi.rb:600:in `each_cgi'
  /usr/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'
  /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in `process!'
  /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in `process!'
  /u/apps/hp_ald/current/public/dispatch.fcgi:24
almost killed by this error

Where the multipart handler is expecting to read the boundary, it is actually reading data from the middle of my file (about 10k into it). 

Also, the problem only happens if it's apache reverse proxy for https. Reverse proxy for http works fine..
Comment 5 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2006-05-30 11:54:43 UTC
what browser where you using, which version of lighttpd and what size where the files?

please also try version 1.4.11 of lighttpd and checkout the list of knon bugs for it at
http://trac.lighttpd.net/trac/wiki/Release-1.4.11-bugs

i am just speculating here, sorry.
Comment 6 Christian Marie (RETIRED) gentoo-dev 2007-01-29 05:46:14 UTC
If your problem is with the ruby-fcgi bindings, this is not the place to report it. We can't be applying patches that aren't accepted upstream either (not that I know it isn't). Please either make sure this is a problem with how we have packaged the bindings, or report this upstream. Please reopen if you think this really belongs here.
Comment 7 Hans de Graaff gentoo-dev Security 2007-01-29 07:00:36 UTC
The patch described here seem to be in ruby-fcgi 0.8.7 which we don't have in portage yet. I may be able to bump it later this week.