在更新到Rails 6之后,Puma出现了随机500服务器错误,并且没有日志或反馈

问题描述 投票:0回答:1

我无法解决问题。

  CACHE User Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 48063], ["LIMIT", 1]]
  CACHE UserProfile Load (0.0ms)  SELECT "user_profiles".* FROM "user_profiles" WHERE "user_profiles"."user_id" = $1 LIMIT $2  [["user_id", 48063], ["LIMIT", 1]]
  Rendered collection of contents/_author.html.haml [1 times] (Duration: 0.5ms | Allocations: 295)
  Rendered commentables/_comments_count.html.haml (Duration: 0.1ms | Allocations: 124)
  Section Load (0.2ms)  SELECT "sections".* FROM "sections" INNER JOIN "sectionable_sections" ON "sections"."id" = "sectionable_sections"."section_id" WHERE "sectionable_sections"."sectionable_id" = $1 AND "sectionable_sections"."sectionable_type" = $2 ORDER BY "sections"."position" ASC  [["sectionable_id", 35008], ["sectionable_type", "Content"]]
  Rendered contents/_article_teaser.html.haml (Duration: 4.4ms | Allocations: 2781)
  Rendering app/cells/products/index.html.haml
   (0.2ms)  SELECT MAX("products"."updated_at") FROM "products" WHERE "products"."state" = $1 AND "products"."published_at" <= '2020-04-24 10:10:03.771036'  [["state", "active"]]
   (1.3ms)  SELECT COUNT(*) FROM "products" WHERE "products"."state" = $1 AND "products"."published_at" <= '2020-04-24 10:10:03.771036'  [["state", "active"]]
  Product Load (1.1ms)  SELECT "products".* FROM "products" WHERE "products"."state" = $1 AND "products"."published_at" <= '2020-04-24 10:10:03.771036' ORDER BY "products"."published_at" DESC LIMIT $2  [["state", "active"], ["LIMIT", 10]]
  Rendered app/cells/products/_product_widget.html.haml (Duration: 1638.9ms | Allocations: 975442)
  Rendered app/cells/products/index.html.haml (Duration: 1643.5ms | Allocations: 976263)
  Rendered home/_aside_4.html.haml (Duration: 1644.2ms | Allocations: 976734)
  Rendered home/index.html.haml within layouts/application (Duration: 1941.8ms | Allocations: 1085299)
Completed 500 Internal Server Error in 1979ms (ActiveRecord: 155.0ms | Allocations: 1103473)

有时在开发过程中出现此Puma服务器错误。我尚未在暂存服务器上部署代码,但是我担心这些错误。

没有日志,什么也没有。如果退出并重新启动服务器,一切正常,则不是代码问题。有什么主意吗?

ruby-on-rails puma
1个回答
0
投票

您可以在config/environments/development.rb中尝试并使用:

##config/environments/development.rb
config.log_level = :debug ## add this line

这至少应该使您获得某种回溯,以便您可以开始发现问题。

© www.soinside.com 2019 - 2024. All rights reserved.