重定向到错误页面没有解释

时间:2016-10-29 18:50:17

标签: ruby-on-rails redirect paperclip puma

我有一个rails应用,用户可以上传文件(使用paperclip)。上传大文件时,用户被重定向到500错误页面,这只发生在远程;在本地,用户被重定向到新模型的视图,如预期的那样。此外,尽管存在错误页面重定向,但模型及其相关文件已成功上载和创建。

由于它只发生在大文件中,我怀疑这是由于请求超时,但我使用puma doesn't enforce such timeouts

那是应用程序日志,美洲狮日志没有显示任何异常。

D, DEBUG -- :   SQL (0.4ms)  INSERT INTO "posts" [...]
D, DEBUG -- :    (0.9ms)  COMMIT
D, DEBUG -- :    (0.1ms)  BEGIN
D, DEBUG -- :    (0.1ms)  COMMIT
I, INFO -- : Started GET "/500.html" for [...]
F, FATAL -- :
ActionController::RoutingError (No route matches [GET] "/500.html"):
  actionpack (4.2.6) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.6) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.6) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.6) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.6) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.6) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.6) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.6) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.6) lib/rails/engine.rb:518:in `call'
  railties (4.2.6) lib/rails/application.rb:165:in `call'
  puma (3.6.0) lib/puma/configuration.rb:225:in `call'
  puma (3.6.0) lib/puma/server.rb:578:in `handle_request'
  puma (3.6.0) lib/puma/server.rb:415:in `process_client'
  puma (3.6.0) lib/puma/server.rb:275:in `block in run'
  puma (3.6.0) lib/puma/thread_pool.rb:116:in `block in spawn_thread'

1 个答案:

答案 0 :(得分:0)

我在nginx日志中找到了答案:确实是暂停。 proxy_read_timeout中增加nginx.conf解决了问题(默认值为60)。