Google app engine error the server encountered a temporary error and could not complete your request - node.js

I am using Google app engine and previously everything was working fine but now when I am trying to deploy my app then i am facing this error.
Then i tried to see in my logs and in logs i found the error logs were
[error] 32#32: *2211 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 130.211.0.251, server: , request: "GET /_ah/health HTTP/1.1", upstream: "http://172.17.0.1:8080/_ah/health", host: "10.142.0.4"
Why am I getting this error? Previously everything was working fine and I haven't changed anything in my code.
I have also seen this SO post /appengine-nodejs-random-the-server-encountered-a-temporary-error-and-could-not but i cannot delete all versions of my app engine and try again.

I don't know why but problem was occuring because i was running my nodejs app on Port 3000, but as i changed it to 8080 now it is working fine. I think default port google cloud uses is 8080 maybe.

Related

504 Gateway Timeout error with NuxtJS application running on Nginx

I have a Nuxt JS SSR site hosted on digital ocean. I am using nginx as reverse proxy with configuration as described at Nuxtjs website. I also use pm2 to run nuxt app. Everything works fine until I gat 504 and 502 errors. When I check ngnix logs it shows erros like this:
"[error] 2767773#2767773: *1655282 upstream timed out (110: Connection
timed out) while reading response header from upstream, client:
x.x.x.x, server: leadersport.ge, request: "GET /news/devils HTTP/1.1",
upstream: "http://x.x.x.x:8000/xxxx/xxxx", host: "xxx.com"
It seems like there is problem with Nuxtjs app. I inspected my Nuxtjs application(I use pm2 monit, and also I log every error inside my nuxtjs app) but it seems to work fine. After 504 error I check nuxtjs logs and there seems to be no problem. Could it be that I miss something regarding nuxtjs app? If so how could I find out what is exactly the problem with nuxtjs app? Or could it be the problem with nginx configuration?
I also check memory and cpu usage and it seems to be okay.

Angular 2 Routing with Amazon EC2 404 error

I am trying to get a deployment of a MEAN stack app using angular2 v1.0.0 beta.3 up and running. Everything is going well so far except this annoying routing issue that did NOT occur when I deployed to Heroku. However; this is my first experience deploying to ec2 using elastic beanstalk.
When I open up the route at the base route / the page loads as normal and I can use the app as if nothing is wrong. However, if I navigate to a subroute, in my case /client/issue/:id , the state loads, but if I reload the page I will get a 404 ERROR. In my server.js I have what I thought was a 404 catch app.get('*', loadIndex'), but this does not seem to be the case. I assume it is an issue with the way ec2 handles routing, but I am not sure.
EDIT
It might also be worth noting that I am only getting an error in my /var/log/nginx/error.log file and not the /var/log/nodejs/nodejs.log file.
From the error.log file:
2016/04/06 15:14:00 [error] 18952#0: *16 open() "/var/app/current/client/Issue/yes/57044092fe1924e77d9049ab" failed (2: No such file or directory), client: 172.31.4.202, server: , request: "GET /client/Issue/yes/57044092fe1924e77d9049ab HTTP/1.1",

Deploying on beanstalk with express 4 build

I followed the instructions here http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html and it works fine if I use the aws examples.
But when I tried it by myself, the basic Express skeleton, expected to give an output of "Express \n Welcome to Express", isn't working and is giving a 502 Bad Gateway error.
I noticed that my build is with Express 4.2 whereas the aws examples use Express 3.x.
From the beanstalk logs:
2014/06/28 03:41:57 [error] 1930#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xx.xxx.xx, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "my-env-xxxxxxxxxn.elasticbeanstalk.com"
There is no database, and no code changed from the skeleton generated by express.
(And btw, it works just fine if I do a npm start locally on my mac)
Please help.
Update: The solution mentioned in the link below answer works in this case.
502 Bad Gateway Deploying Express Generator Template on Elastic Beanstalk
Though it is not clear to me exactly why AWS would execute in that order.

Getting "The connection to 'localhost' failed" error when trying to browse localhost site on IIS

My localhost IIS sites recently stopped working and I can't figure out why. If I try and browse to http://localhost after a while I get the error Oops! Google Chrome could not connect to localhost. If I open Fiddler and try again I get a 502 error that states System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 127.0.0.1:80
I've tried using netstat -a -b to see if any other applications are blocking port 80, but there doesn't appear to be anything obvious.
I've disabled proxy servers and that doesn't have any affect.
As a last resort I even tried re-installing IIS
Everything has been working fine and I can't think of any configuration changes that would've stopped localhost from working. Any ideas?

Node.js application not loadingproperly in Chromium: Connection timed out while reading response header from upstream

I'm running a Node.JS application in the subdomain of WP site. The WP site itself is running on Nginx, php-fpm and Varnish and works just fine, so I'm using Nginx to proxy connections to the Node app.
With Firefox, the Node app works perfectly. The home page and every other page loads, including the admin end. However, on Chromium, the site does not load properly. If I attempt to view the home page, the main content area loads, but the sidebar does not. And I get the following message in the Web console:
WebSocket connection to 'ws://forum.site.com/socket.io/1/websocket/91qNR-mt333a'
failed: Unexpected response code: 502
In the Nginx log file, I see entries like:
2089 upstream prematurely closed connection while reading response header from upstream,
client: 127.0.0.1, server: forum.site.com, request: "GET /socket.io/1/websocket/91qNR-
mt333a HTTP/1.1", upstream: "http://127.0.0.1:4567/socket.io/1/websocket/91qNRaWZ3-
mt333a", host: "forum.site.com"
And if I try to navigate between posts on the site, I get these messages in the Web console:
Failed to load resource: the server responded with a status of 504 (Gateway Time-out)
http://forum.site.com/socket.io/1/xhr-polling/91qNRaWZ3rYcF-mt333a?t=1396434040701
Then these lines from Nginx error log:
2128 upstream timed out (110: Connection timed out) while reading response header from
upstream, client: 127.0.0.1, server: forum.site.com, request: "GET /socket.io/1/xhr-
polling/uH9QTAWUGmomqFoy333e?t=1396434162051 HTTP/1.1", upstream:
"http://127.0.0.1:4567/socket.io/1/xhr-polling/uH9QTAWUGmomqFoy333e?t=1396434162051",
host: "forum.site.com", referrer: "http://forum.site.com/category/35/dual-boots"
I've looked at similar issues on this site and other sites and tried to implement the suggested solutions, but no luck so far. For example, in the Nginx config for the subdomain, I've added the following:
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_connect_timeout 120;
proxy_read_timeout 300;
And played around with different values for the last two lines, but still no luck.
What baffles me is that the site works perfectly on FF. It's only on Chromium that I'm having these problem. I've not tried on IE, but I'm not really concerned about that browser at this point.
I'm sure there's something that I'm overlooking, but I don't know what.
Btw, the site exhibits the same behavior on Android's default browser.
Could Varnish be the culprit here. I have Varnish (port 80) in front of Nginx (8080). Does Varnish play nice with WebSockets?
Finally figured out that the problem is with Varnish, which by default does not handle WebSocket traffic. It has to be explicitly configured for it.
See this link for the solution.

Resources