Dynamic calls to the server throws (104: Connection reset by peer) while reading response header from upstream.How to fix this error.

Posted February 15, 2017 5k views

Some time back, the root user password has been changed.After that while contacting nginx server, the connection was not established. Restarting the php5-fpm has resolved that issue.But we are getting ‘Connection reset by peer’ error while making post calls to the server. We are using node js server in the backend.

boot.log shows :

You are required to change your password immediately (root enforced)
su: Authentication token is no longer valid; new one required
Cloud-init v. 0.7.5 running 'modules:config’ at Sun, 22 Jan 2017 11:53:15 +0000. Up 10.82 seconds.

  • Stopping Handle applying cloud-config^[[74G[ OK ] ^[[32m[PM2] ^[[39mSpawning PM2 daemon ^[[32m[PM2] ^[[39mPM2 Successfully daemonized ^[[32m[PM2] ^[[39mResurrecting ^[[32m[PM2] ^[[39mRestoring processes located in /root/.pm2/dump.pm2 ^[[31m[PM2][ERROR] ^[[39mNo processes saved; DUMP file doesn’t exist
  • Restoring resolver state… ^[[128G ^M^[[122G[ OK ]
  • Starting authentication failure monitor fail2ban ^[[128G ^M^[[122G[ OK ]
  • Stopping System V runlevel compatibility^[[74G[ OK ]

php5-fpm log shows:

[15-Feb-2017 06:40:05] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

[15-Feb-2017 06:40:16] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

[15-Feb-2017 15:21:29] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @Seetha93,

I know this question is bit old in terms of how fast stuff are evolving, but I still think it’s good to have it cleared up, so, looking for answers on the web, I came up with the following three possibilities:

The error provided suggests the issue is coming from PHP-FPM. You’ll need to enable the catch_workers_output module. This can be set
in /etc/php5/fpm/pool.d/www.conf. As soon as you do, restart the service and check your php5-fpm.log. Check the log and it should provide more descriptive errors.