qweewq
@qweewq
ruby, ruby on rails, devops

Ошибка загрузки больших файлов?

Ошибка загрузки больших файлов (>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;
...



В tmp после ошибки остаётся файл RackMultiart размером ровно 2G, приложение выпадает с ошибкой:
/!\ 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


Как исправить?
  • Вопрос задан
  • 3755 просмотров
Пригласить эксперта
Ответы на вопрос 1
@Otkrick
Если есть возможность, попробуйте перевести в режим разработчика: RAILS_ENV='development' и повторите загрузку.
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы