Вызов send_file с filepath, файл удаляется и send_data выдает «Нет такого файла или каталога @ rb_sysopen» - PullRequest
1 голос
/ 22 апреля 2019

Я пытаюсь загрузить файл xls, используя send_file file_path, :content_type => "application/vnd.ms-excel", :filename => File.basename(file_path), но получаю сообщение об ошибке "Нет такого файла или каталога @ rb_sysopen".

Я использую рельсы 3.2.21 и соответствующий пакет действий 3.2.21

Я добавил File.exist?(file_path), который возвращает true.Но при выполнении метода send_file файл удаляется и выдает ошибку.Ниже приведена стека трассировки

App 9174 stderr: [ 2019-04-22 17:01:07.8144 9229/0x005579aae50758(Worker 1) utils.rb:85 ]: *** Exception Errno::ENOENT in Rack response body object (No such file or directory @ rb_sysopen - /usr/share/app_name/public/data-20190422-170057.xls) (process 9229, thread 0x005579aae50758(Worker 1)):
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/actionpack-3.2.21/lib/action_controller/metal/data_streaming.rb:93:in `initialize'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/actionpack-3.2.21/lib/action_controller/metal/data_streaming.rb:93:in `open'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/actionpack-3.2.21/lib/action_controller/metal/data_streaming.rb:93:in `each'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/actionpack-3.2.21/lib/action_dispatch/http/response.rb:44:in `each'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/activerecord-3.2.21/lib/active_record/query_cache.rb:46:in `each'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/connection_pool.rb:460:in `each'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/rack-1.4.7/lib/rack/body_proxy.rb:31:in `each'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/rack/thread_handler_extension.rb:297:in `process_body'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/rack/thread_handler_extension.rb:143:in `process_request'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/request_handler/thread_handler.rb:157:in `accept_and_process_next_request'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
App 9174 stderr:        from /usr/lib/ruby-flo/lib/ruby/gems/2.2.0/gems/passenger-5.0.15/lib/phusion_passenger/utils.rb:111:in `block in create_thread_and_abort_on_exception'
[ 2019-04-22 17:01:07.8150 9011/7efd5ffff700 Ser/Server.h:929 ]: [Client 1-2] Disconnecting client with error: error parsing app response chunked encoding: unexpected end-of-stream

Это работало с рельсами 3.1.3, но из-за обновления нашей ОС нам пришлось обновить рельсы 3.2.21, и это перерыв.Дайте мне знать, если какой-либо другой вклад я должен предоставить.

...