简体   繁体   English

(Cloud Foundry, Node.js) 502 Bad Gateway:注册端点无法处理请求

[英](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.

相关问题 获取502错误的网关:尝试在PCF平台中使用节点js连接mongodb时,注册端点无法处理请求 - Getting 502 Bad Gateway: Registered endpoint failed to handle the request when tried to connect mongodb using node js in PCF platform AWS API 网关与 Lambda HTTP GET 请求(Node.js)502 错误网关 - AWS API Gateway with Lambda HTTP GET Request (Node.js) 502 Bad Gateway Node.js/Express.js/consign(): 默认请求有效 ("/") 但 ("/tasks") 返回 502:Bad Gateway - Node.js/Express.js/consign(): default request works ("/") but ("/tasks") returns a 502:Bad Gateway Node.js和Docker- Elastic Beanstalk 502错误网关 - Node.js and Docker- Elastic Beanstalk 502 Bad Gateway 带有 nginx 502 错误网关错误的 node.js 应用程序 - node.js app with nginx 502 bad gateway error 在 node.js 的生产服务器上获取 502 Bad Gateway - Getting 502 Bad Gateway on the production server for node.js 弹性beantalk上的node.js:Firefox 502错误网关 - node.js on elastic beanstalk: firefox 502 bad gateway 验证密码时出现“ 502错误的网关:请求端点无法处理” - Getting “502 bad gateway: request endpoint unable to handle” while validating the password Nginx 502 错误的网关节点 JS - Nginx 502 Bad Gateway Node JS 托管 Cloud Foundry Node.js 应用程序 - Hosting a Cloud Foundry Node.js application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM