Problems with flash upload, strange failsafe error

I have an upload page for uploading multiple mp3 files using
uploadify.
For me it works perfectly, however one of my users reports
intermittent problems, and indeed, errors appear in the logs.

My set up:
Rails 2.3.5 + datamapper 0.10.2, latest uploadify, Ruby EE 1.8.7
2009.10, passenger 2.2.9

Here is a successful uploadify post from the user:

Processing Media::Lessons::DaysController#create (for x.x.x.x at
2010-01-20 12:59:16) [POST]
Parameters: {“Filename”=>“20100124_sun.mp3”,
“_chronicles_session”=>"…blablabla…", “folder”=>"/media/lessons/
days/", “action”=>“create”,
“authenticity_token”=>"…moreblablabla…", “Upload”=>“Submit Query”,
“fileext”=>"*.mp3", “controller”=>“media/lessons/days”,
“Filedata”=>#<File:/tmp/RackMultipart20100120-4207-dnd6as-0>}
Completed in 1125ms (View: 1 | 200 OK

And here is a failed one:

/!\ FAILSAFE /!\ Wed Jan 20 13:00:35 +1100 2010
Status: 500 Internal Server Error
You have a nil object when you didn’t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/methodoverride.rb:15:in call' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ actionpack-2.3.5/lib/action_controller/params_parser.rb:15:incall’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in
call' /srv/app/chronicles/003/app/middleware/ flash_session_cookie_middleware.rb:19:incall’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in call' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ rack-1.0.1/lib/rack/lock.rb:11:incall’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/lock.rb:11:in synchronize' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ rack-1.0.1/lib/rack/lock.rb:11:incall’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/dispatcher.rb:106:in call' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/rack/request_handler.rb:92:inprocess_request’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_request_handler.rb:
207:in main_loop' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb: 400:instart_request_handler’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb:
351:in handle_spawn_application' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/utils.rb:184:insafe_fork’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb:
349:in handle_spawn_application' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:insend
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in
main_loop' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:196:instart_synchronously’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:163:in
start' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/railz/application_spawner.rb: 209:instart’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/railz/framework_spawner.rb:
291:in handle_spawn_application' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb: 126:inlookup_or_add’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/railz/framework_spawner.rb:
286:in handle_spawn_application' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb: 80:insynchronize’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb:
79:in synchronize' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/railz/framework_spawner.rb: 284:inhandle_spawn_application’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in
__send__' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:inmain_loop’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:196:in
start_synchronously' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:163:instart’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/railz/framework_spawner.rb:
101:in start' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:262:inspawn_rails_application’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb:
126:in lookup_or_add' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:256:inspawn_rails_application’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb:
80:in synchronize' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server_collection.rb: 79:insynchronize’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:255:in
spawn_rails_application' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:154:inspawn_application’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/spawn_manager.rb:287:in
handle_spawn_application' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:insend
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:352:in
main_loop' /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/ passenger-2.2.9/lib/phusion_passenger/abstract_server.rb:196:instart_synchronously’
/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/
passenger-2.2.9/bin/passenger-spawn-server:61

I have looked at methodoverride.rb but I don’t really get what’s going
on.
The error occurs here (methodoverride.rb line 15):


def call(env)
if env[“REQUEST_METHOD”] == “POST”
req = Request.new(env)
method = req.POST[METHOD_OVERRIDE_PARAM_KEY] || #<--------
line 15
env[HTTP_METHOD_OVERRIDE_HEADER]
method = method.to_s.upcase
if HTTP_METHODS.include?(method)
env[“rack.methodoverride.original_method”] = env
[“REQUEST_METHOD”]
env[“REQUEST_METHOD”] = method
end
end

  @app.call(env)
end

Anyone have any ideas?
The error persists with all versions of passenger I have tried (2.2.4
to 2.2.9)

Thanks,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs