狂欢 - 尝试访问后端时超时

Max*_*Max 4 ruby dns timeout ruby-on-rails spree

从今天下午开始,突然无法访问我的狂欢商店的后端.当我尝试访问后端中的任何页面(/ admin/users,/ admin/orders等)时,页面会加载很长时间,直到它超时并且我得到通用错误页面.

当我查看日志时,我总是看到:

Processing by Spree::Admin::OrdersController#index as HTML
Completed 500 Internal Server Error in 127259ms
** [Airbrake] Success: Net::HTTPOK

Errno::ETIMEDOUT (Connection timed out - connect(2)):
  app/middleware/flash_session_cookie_middleware.rb:18:in `call'
Run Code Online (Sandbox Code Playgroud)

要么

Processing by Spree::Admin::OrdersController#index as HTML
Completed 500 Internal Server Error in 127520ms
** [Airbrake] Success: Net::HTTPOK

SocketError (getaddrinfo: Name or service not known):
app/middleware/flash_session_cookie_middleware.rb:17:in `call'
Run Code Online (Sandbox Code Playgroud)

这是在最后一次部署到生产之后开始的,它只更改了图像和样式表.尽管具有相同的代码和生产数据库的精确副本,但我无法在本地重现错误.我正在使用Spree 2.0.3版

Ian*_*bel 11

Spree::Config[:check_for_spree_alerts] = false在您的控制台中运行以解决此问题.您可能还希望将此行添加到您的行中,initializers/spree.rb以确保check_for_spree_alerts将来不会重新启用此行.

这种情况正在发生,因为Spree Alerts网站已经停止使用.请参阅:https://github.com/spree/spree/pull/6516

具体而言,这种情况正在发生,因为当登录到后端时,Spree 2.0.x会检查Spree网站上的任何警报https://github.com/spree/spree/blob/2-0-stable/backend/app /controllers/spree/admin/base_controller.rb#L39然后调用alert.rb:14:

HTTParty.get('http://alerts.spreecommerce.com/alerts.json', query: params).parsed_response
Run Code Online (Sandbox Code Playgroud)

目前,alerts.spreecommerce.com已经停止并且超时,这解释了您收到的错误.

从Spree 2.3开始,Spree Alerts代码已被删除,因此您也可以升级到该版本以解决此问题.