D
D
Denis Savitsky2012-11-28 15:16:00
Nginx
Denis Savitsky, 2012-11-28 15:16:00

Error uploading large files?

Error uploading large files (>2G).
Nginx.conf:

...
    passenger_root /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8;
    passenger_ruby /usr/local/bin/ruby;
    passenger_max_pool_size  3;
    passenger_pool_idle_time 1200;

    include       mime.types;
    default_type  application/octet-stream;

    sendfile           on;
    client_max_body_size 0;
    client_body_temp_path /opt/spool 1 2;
...

In tmp, after an error, the RackMultiart file is exactly 2G in size, the application crashes with an error:
/!\ FAILSAFE /!\  Wed Nov 28 15:05:44 +0400 2012                                                                     
  Status: 500 Internal Server Error                                                                                  
  bad content body                                                                                                   
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/utils.rb:560:in `parse_multipart'                                                                                                    
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/utils.rb:525:in `loop'                                                                                                               
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/utils.rb:525:in `parse_multipart'                                                                                                    
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/request.rb:268:in `parse_multipart'                                                                                                  
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/request.rb:146:in `POST'                                                                                                             
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/methodoverride.rb:15:in `call'                                                                                                       
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'                                                                                                          
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:99:in `call'                                                                                                   
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'                                                                                                               
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call'                                                                                                                 
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/lock.rb:11:in `synchronize'                                                                                                          
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/bundle/ruby/1.8/gems/rack-1.1.3/lib/rack/lock.rb:11:in `call'                                                                                                                 
    /opt/vhod/webapp/releases/20121128082110/redmine/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'                                                                                                            
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'                                                                                                               
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'                                                                                          
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'                                                                                                                
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'                                                                                           
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'                                                                                                            
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'                                                                                        
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/utils.rb:479:in `safe_fork'              
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'                                                                                        
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `__send__'     
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'                                                                                                                  
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'                                                                                                               
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:180:in `start'        
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'                                                                                                           
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'                                                                                                             
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'                                                                                                          
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'                                                                                                             
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'                                                                                                             
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'                                                                                                             
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'                                                                                                             
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'                                                                                                                   
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'                                                                                                            
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `__send__'     
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'                                                                                                                  
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'                                                                                                               
    /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.8/helper-scripts/passenger-spawn-server:99

How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Otkrick, 2012-12-11
@Otkrick

If possible, try switching to developer mode: RAILS_ENV='development' and try downloading again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question