#46 ✓resolved
Nate Wiger

Rack in Ruby 1.9 throws fatal error on small uploads

Reported by Nate Wiger | April 15th, 2009 @ 12:19 PM

We have found a specific situation with binary multipart uploads causing Rack with Rails 2.3.2 to throw a fatal error.

The specific files we have tested shows that >= 112kb works, <= 110k fails. The error thrown up from Rack is:

/!\ FAILSAFE /!\ 2009-04-14 17:23:32 -0400 Status: 500 Internal Server Error invalid byte sequence in US-ASCII

/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/utils.rb:320:in `=~'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/utils.rb:320:in `block in parse_multipart'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/utils.rb:315:in `loop'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/utils.rb:315:in `parse_multipart'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/request.rb:125:in `POST'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:15:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/session/abstract_store.rb:122:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `block in call'
<internal:prelude>:8:in `synchronize'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/cgi_process.rb:44:in `dispatch_cgi'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:102:in `dispatch_cgi'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:28:in `dispatch'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/rack/adapter/rails.rb:54:in `serve_rails'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/rack/adapter/rails.rb:74:in `call'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/connection.rb:63:in `pre_process'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/connection.rb:54:in `process'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/connection.rb:39:in `receive_data'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.6/lib/eventmachine.rb:240:in `run_machine'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.6/lib/eventmachine.rb:240:in `run'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/backends/base.rb:57:in `start'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/server.rb:150:in `start'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/controllers/controller.rb:80:in `start'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/runner.rb:173:in `run_command'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/lib/thin/runner.rb:139:in `run!'
/usr/playerconnect-stack-2009c/lib/ruby/gems/1.9.1/gems/thin-1.0.0/bin/thin:6:in `<top (required)>'
/usr/playerconnect-stack-2009c/bin/thin:19:in `load'
/usr/playerconnect-stack-2009c/bin/thin:19:in `<main>'

The attached file fails in our tests.

I have also posted this to the Rails lighthouse app, before I found the lighthouse ticket list. Another user has confirmed it's Rack with Ruby 1.9 only:

https://rails.lighthouseapp.com/projects/8994/tickets/2497-rack-in-...

Any help is MUCH appreciated.

Thanks, Nate

Comments and changes to this ticket

  • raggi

    raggi May 1st, 2009 @ 03:17 PM

    • Assigned user set to “raggi”
    • State changed from “new” to “resolved”

    This was fixed in 9abab4a36b10a0ce3f667ef1099e3361a648f425.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Pages