• Register
0 votes
254 views

Problem :

Currently I am using the nginx and node server to serve the update requests. I often face the gateway timeout whenever I request an update on large data. I saw below error from the nginx error logs as below :

2019/04/07 00:46:04 [error] 28599#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 10.0.2.77, server: gis.oneconcern.com, request: "GET /update_mbtiles/atlas19891018000415 HTTP/1.1", upstream: "http://127.0.0.1:7777/update_mbtiles/atlas19891018000415", host: "gis.oneconcern.com"

I tried everything that I could, but I still I face the same error.

The nginx configuration has below proxy settings :

    #############

    # Proxy settings

    #############

    proxy_connect_timeout 1000;

    proxy_send_timeout 1000;

    proxy_read_timeout 1000;

    send_timeout 1000;

 

I am trying to use the nodejs backend to serve the requests on an aws server. My gateway error shows up only when a update takes the long time around 3-4 minutes. Please note I do not get the error for smaller updates. Please let me know how can I resolve the issue.

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I also had the same error for quite a while in recent past, and below is what fixed it for me.

I just declared in service that i use what is given below :

Description= The node service description

After= network.target

[Service]

Type=forking

PIDFile=/tmp/node_pid_name.pid

Restart=on-failure

KillSignal=SIGQUIT

WorkingDirectory=/path/to/your /node/app/root/directory

ExecStart=/path/to/your/node /path/to/server.js

[Install]

WantedBy=multi-user.target

Please note "After=network.target". I spent many days looking for the fixes on nginx side, while my problem was just that. To be very sure just stop running the node service you have and  launch the ExecStart command directly and try to just reproduce the bug. If it does not show up, it clearly means that your service has all the problems. This is how I found my answer.

9 7 4
38,600 points

Related questions

0 votes
1 answer 584 views
584 views
Problem : My Environment is Nginx + uwsgi and I am very new to it. I am getting a 502 bad gateway error from Nginx on certain GET requests. It seems to be related to a length of URL.. Please find below the nginx/error.log [error] 22113#0: *1 recv ... response header from upstream, client: 192.168.1.100, server: server.domain.com, request: "GET <long_url_here>" Can somebody solve this issue?
asked Nov 27, 2019 alecxe 7.5k points
0 votes
1 answer 301 views
301 views
Problem : I want to set up the hello world example with AWS lambda and serving it through the api gateway. I clicked a "Create a Lambda Function", which set up a api gatway and selected a Blank Function option. I added a lambda function found on AWS ... response { "message": "Internal server error" }. And my logs say "Execution failed due to configuration error: Malformed Lambda proxy response".
asked Jan 22 jwilliam 3.9k points
0 votes
1 answer 1.2K views
1.2K views
Problem : I had recently uninstalled the Postgres10 and after that reinstalled the Postgres10. After that I went to run a Node, Express, React application that relies on connecting to a Postgres10 database and also communicates with it using Sequelize. Initially I was unable to ... app at in the browser. Does anyone have any idea what is going wrong? Please suggest me the solution for my error.
asked Nov 22, 2019 peterlaw 6.9k points
1 vote
1 answer 262 views
262 views
Problem: I am very new to node so I think I am making something extremely wrong here as I am unable to find any info at all by doing research online. I already have the django site and I required the JS charting library so I chose the chart.js. I have ... build a chart. Failed to create chart: can't acquire context from the given item . Please help me in fixing above NodeJs elated error.
asked Jun 4 Martin K 6.6k points
0 votes
2 answers 1.2K views
1.2K views
Problem : Currently I am using VueJS and Laravel for the project. Following issue started to show lately and it also comes up even in the old git branches. Unchecked runtime.lasterror: the message port closed before a response was received. This error only comes up in Chrome browser.
asked Dec 10, 2019 alecxe 7.5k points