[英](Cloud Foundry, Node.js) 502 Bad Gateway: Registered endpoint failed to handle the request
After a few days, sometimes my previously running application will flake out with this error and no longer load.几天后,有时我以前运行的应用程序会因这个错误而崩溃,不再加载。 I have searched, but have not found the cause.我已经搜索过,但没有找到原因。 I have a hunch that it may be because I'm giving my Node.js app only 256MB memory, but cannot confirm.我有一种预感,这可能是因为我只给我的 Node.js 应用程序提供了 256MB 内存,但无法确认。 Any recommendations?有什么建议吗?
I was facing same issue, that was related to PORT
using, I had given Hardcoded value in PORT
that was an issue, then I used AppEnv
of cfenv
module and used AppEnv().port
.我遇到了同样的问题,这与PORT
使用有关,我在PORT
中给出了 Hardcoded 值,这是一个问题,然后我使用了AppEnv
模块的cfenv
并使用AppEnv().port
。
This solved my issue.这解决了我的问题。
A 502 error can mean a variety of things, but without any logs, it is difficult to say for sure. 502 错误可能意味着多种情况,但如果没有任何日志,则很难确定。
I agree that there is a good chance that your app is potentially running out of memory given the symptoms (or there could be a code bug which is causing some kind of unresponsive behavior).我同意,鉴于这些症状,您的应用很有可能会耗尽内存(或者可能存在导致某种无响应行为的代码错误)。
There could be internal Cloud Foundry GoRouter / networking problems, but to debug those, you would probably need to CF SSH into a running container and trace packets.可能存在内部 Cloud Foundry GoRouter / 网络问题,但要调试这些问题,您可能需要将 CF SSH 插入正在运行的容器并跟踪数据包。 When you push the app again, you will most-likely get deployed to different machines, so many times network issues will resolve when that happens.当你再次推送应用程序时,你很可能会被部署到不同的机器上,所以很多时候网络问题会在这种情况下得到解决。 (Given the seemingly consistent behavior of your error, I think this is unlikely.) (鉴于您的错误看似一致的行为,我认为这不太可能。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.