Rails 中非常有限的 502 Bad Gateway 错误 [英] Very limited 502 Bad Gateway error in Rails

查看:64
本文介绍了Rails 中非常有限的 502 Bad Gateway 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这太奇怪了.

我的一个客户一直收到 502 Bad Gateway 错误(在每个浏览器中都没有失败),但只有在我的 Rails 站点的一个特定页面上,她才能正常访问其余页面.此外,其他所有人(包括同一公司网络上的人员)都可以正常访问同一页面.此外,production.log 不包含任何错误痕迹,它表示页面呈现 200 OK.这可能是什么原因造成的???

One of my clients has been consistently getting 502 Bad Gateway errors (without fail and in every browser), but only on one particular page of my Rails site, she can access the rest of the pages normally. Also, everybody else (including people on the same company network) can access the same page fine. Also, the production.log does not contain any trace of an error, it says the page was rendered 200 OK. What could possibly be causing this???

我已经仔细检查了其他 Rails 错误,例如尝试调用不存在的产品 ID 的详细信息,而是导致 404 错误.

I have double-checked that other Rails errors, such as trying to call up the details of a product id that doesn't exist, result in a 404 error instead.

推荐答案

我找到了.这是页面标题(会话对象 -> cookie)变得太大的错误.我正在使用 Facebook 身份验证并将 Facebook 用户会话存储在会话对象中.对于这个人来说,她在 Facebook 上的个人信息太长了,以至于她在其他人都很好的时候出现了这个错误.我通过仅在会话对象中存储 Facebook ID 来修复错误.

I found it. This was an error with page headers (session object -> cookie) getting too large. I'm using Facebook authentication and was storing the Facebook user session in the session object. For this one person, her personal information on Facebook was too long, so that she was getting this error while everybody else was fine. I fixed the error by only storing the Facebook ID in the session object.

这篇关于Rails 中非常有限的 502 Bad Gateway 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆