Getting an exception in actionpack: "invalid byte sequence in US-ASCII" with ruby 1.9


#1

After upgrading to Ruby 1.9 and Passenger, we started getting this
while uploading a binary data file through a form. I’m not sure if
it’s ruby 1.9 or passenger, but either way, any help would be greatly
appreciated.

/!\ FAILSAFE /!\ 2009-05-28 00:39:30 +0000
Status: 500 Internal Server Error
invalid byte sequence in US-ASCII
d /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/
action_controller/vendor/rack-1.0/rack/utils.rb:320:in =~' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:320:inblock in
parse_multipart’
/usr/local/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/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:315:inparse_multipart’
/usr/local/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/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/methodoverride.rb:15:incall’
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/
action_controller/params_parser.rb:15:in call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/rewindable_input.rb:25:incall’
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/
action_controller/session/cookie_store.rb:93:in call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/failsafe.rb:11:incall’
/usr/local/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:insynchronize’
/usr/local/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/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:106:incall’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/rack/request_handler.rb:81:in process_request' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_request_handler.rb:203:inmain_loop’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/railz/application_spawner.rb:340:in
start_request_handler' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:298:inblock in
handle_spawn_application’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/utils.rb:181:in safe_fork' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:296:inhandle_spawn_application’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/abstract_server.rb:337:in main_loop' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:187:instart_synchronously’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/abstract_server.rb:154:in start' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:192:instart’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/spawn_manager.rb:257:in block (2 levels) in spawn_rails_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server_collection.rb:126:inlookup_or_add’
/usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/
phusion_passenger/spawn_manager.rb:251:in block in spawn_rails_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server_collection.rb:80:inblock in
synchronize’
internal:prelude:8:in `synchronize’


#2

I ran into a similar problem a while back. Here’s an email thread
that might help:

http://groups.google.com/group/rack-devel/browse_thread/thread/76065d11ea3d55c2/13c8e39c788186a8?hl=en&lnk=gst&q=rick#13c8e39c788186a8

Rick