• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue NGNIX ERROR "upstream timed out (110: Connection timed out)"

DTAlfonso

New Pleskian
Hello,
I tried them all but at certain times I noticed that all the domains I have on the plesk server give me this error code

Code:
7926#0: *46677 upstream timed out (110: Connection timed out) while connecting to upstream
24133#0: *42707 upstream timed out (110: Connection timed out) while connecting to upstream
24133#0: *37804 upstream timed out (110: Connection timed out) while SSL handshaking to upstream

the only way is to change any type of setting from the panel of any domain and everything starts up again, but the next day and especially at certain times (morning and evening) the error reappears, I don't know what else to try someone can help me ?
Thank you
 
First thing to look at in this case according to the symptom described is the Fail2Ban whitelist. Does it include your local IP address of the server? If not, add it there, then unblock it from the blocked ip list.
 
First thing to look at in this case according to the symptom described is the Fail2Ban whitelist. Does it include your local IP address of the server? If not, add it there, then unblock it from the blocked ip list.

Yes I checked and you write my server ip is in the "Trusted ip Andresses" list what else should I check?
 
If you install the "watchdog" extension, this will enable you to automatically monitor Apache and let Watchdog restart Apache automatically in case it fails. This will still not solve the failure itself, but the downtime will be only a few minutes in such a case.

In order to resolve the issue fully, you'll need to look through the Apache logs why Apache is failing at some point. Maybe it is an update, maybe simply something like a misconfigured log rotation on your system that forgets to reload or restart Apache after log rotation. This needs to be check on your system. There can be very many reasons for a failure of a service.
 
If you install the "watchdog" extension, this will enable you to automatically monitor Apache and let Watchdog restart Apache automatically in case it fails. This will still not solve the failure itself, but the downtime will be only a few minutes in such a case.

In order to resolve the issue fully, you'll need to look through the Apache logs why Apache is failing at some point. Maybe it is an update, maybe simply something like a misconfigured log rotation on your system that forgets to reload or restart Apache after log rotation. This needs to be check on your system. There can be very many reasons for a failure of a service.

Thanks for your help, I have activated 'watchdog' for now, but honestly I would like to fix the error somehow and not force a restart to "avoid it" :( For now I have also followed this guide: nginx fails to start/reload on a Plesk server: Too many open files I will soon find out if it worked or not. Any other ideas to understand where the mistake is? Thanks again
 
The Upstream is Apache, so you do not need to look at Nginx issues. The issue is with Apache, not with Nginx. You need to check the Apache log files to find out why it is stopping and not restarting.
 
The Upstream is Apache, so you do not need to look at Nginx issues. The issue is with Apache, not with Nginx. You need to check the Apache log files to find out why it is stopping and not restarting.

I understand, the only problem that in the apache logs I don't have any kind of error, but by plesk error it is generated by ngnix, everything makes me confused and I don't know at this point how to check the apache logs: / Thanks again for your time
 
Next time the outage happens, look at
/var/log/messages (a the timestamp when it happens)
/var/log/httpd/*.log (Redhat, CentOS) or /var/log/apache2/*.log (Debian, Ubuntu)
# service status httpd (Redhat, CentOS) or # service status apache2 (Debian, Ubuntu)
for the reason why Apache fails.
 
Next time the outage happens, look at
/var/log/messages (a the timestamp when it happens)
/var/log/httpd/*.log (Redhat, CentOS) or /var/log/apache2/*.log (Debian, Ubuntu)
# service status httpd (Redhat, CentOS) or # service status apache2 (Debian, Ubuntu)
for the reason why Apache fails.
You were not right, but super right the error comes from the apache web server, since this morning it went down it does not restart nor does it reactivate, if I try to log in via ssh to force the restart the server returns me "time out"!
I restarted plesk, but nothing the error continues, I can't even check the logs, not even 'watchdog' was able to restart it.
The error that came to me by email is the following


Unable to generate the web server configuration file on the host <stock.ovh> because of the following errors:

Template_Exception: Can not restart web server: Apache is down, start it instead of graceful
Apache is down, start it instead of graceful

file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 122
code: 0

Please resolve the errors in web server configuration templates and generate the file again.


what can I do now?

##UPDATE

I restarted the vps server and plesk finally recognized the error making me display this banner

"New configuration files for the Apache web server were not created due to the errors in configuration templates: Can not restart web server: Apache is down, start it instead of graceful Apache is down, start it instead of graceful . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter"


I pressed to regenerate all apache config files but nothing "Web Server (Apache) is not running"

Unable to configure the web server: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-all ) Details: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-domains [1] => nosignalservice.it,nosignalstore.it,tribagency.com,uhdcomponents.com ) Details: [2020-10-29 10:27:22.923] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '7080' '--https-port' '7081' '--graceful'] with exit code [255] [2020-10-29 10:27:23.802] ERR [panel] Apache config (16039633890.82857300) generation failed: Template_Exception: Can not restart web server: Apache is down, start it instead of graceful Apache is down, start it instead of graceful file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php line: 122 code: 0 plesk sendmail[8119]: Unable to resolve fqdn: Name or service not known plesk sendmail[8119]: It is impossible to detect the FQDN of the host. Please make sure that the host name is correctly specified in /etc/hosts and goes right after the host's IP address. Depending on your OS, you might need to set the host name in /etc/HOSTNAME or /etc/hostname. plesk sendmail[8119]: Unable to retrieve hostname. Use localhost.localdomain instead. Can not restart web server: Apache is down, start it instead of graceful Apache is down, start it instead of graceful
 
Last edited:
Have you seen this line in the error text?

"Please make sure that the host name is correctly specified in /etc/hosts and goes right after the host's IP address. Depending on your OS, you might need to set the host name in /etc/HOSTNAME or /etc/hostname. plesk"
 
Have you seen this line in the error text?

"Please make sure that the host name is correctly specified in /etc/hosts and goes right after the host's IP address. Depending on your OS, you might need to set the host name in /etc/HOSTNAME or /etc/hostname. plesk"
Now yes, what does this error depend on? How should I solve?
Edit. I don't seem to ever change the plesk namehost it was set by the server manager, the only thing i did was update plesk, but i don't remember if the error showed up after my update :(
 
Last edited:
"Please make sure that the host name is correctly specified in /etc/hosts and goes right after the host's IP address"
This means: Look into /etc/hosts and check if the host name is there followed by the local IP address of your host. If it is missing, add it.
This is an example how it could look: 138.123.123.123 your-host.domain.somewhere.com your-host

"Depending on your OS, you might need to set the host name in /etc/HOSTNAME or /etc/hostname."
This means: Look into /etc/HOSTNAME or /etc/hostname if either of these files exists. One should exist like
-rw-r--r--. 1 root root 5 Feb 24 2020 /etc/hostname
and its only content is the local host name. If it is missing, create it with the permissions as shown in this example.
 
"Please make sure that the host name is correctly specified in /etc/hosts and goes right after the host's IP address"
This means: Look into /etc/hosts and check if the host name is there followed by the local IP address of your host. If it is missing, add it.
This is an example how it could look: 138.123.123.123 your-host.domain.somewhere.com your-host

"Depending on your OS, you might need to set the host name in /etc/HOSTNAME or /etc/hostname."
This means: Look into /etc/HOSTNAME or /etc/hostname if either of these files exists. One should exist like
-rw-r--r--. 1 root root 5 Feb 24 2020 /etc/hostname
and its only content is the local host name. If it is missing, create it with the permissions as shown in this example.
Sorry but i don't have /etc/hosts but i have /etc/resolv.conf

"nameserver 10.0.2.3"

EDIT.

And can't create it :/

(sorry but i am new on plesk server)

thanks for your patience
 
Last edited:
Sorry to read that you are unable to create the file. Have you at least edited /etc/hosts so that you have a name resolution for your IP address to your host name?
 
Sorry to read that you are unable to create the file. Have you at least edited /etc/hosts so that you have a name resolution for your IP address to your host name?
actually I made a very serious mistake, I deleted

"In Tools & Settings> IP:
10.0.2.15 /255.255.255.0
This IP address is not configured properly. Repair eth0 dedicated "

And now webserver does not work, I think we do first if I give you the access data privately to see if you can solve it yourself? I will pay you if it is necessary. Thank you
 
I am sorry, I do not provide individual support. For individual support I suggest to open a support ticket with official Plesk support.
 
I am sorry, I do not provide individual support. For individual support I suggest to open a support ticket with official Plesk support.
Thank you so much for your help, maybe there were all people like you, the internet would be a better way.

However, for the moment I have restored a backup of everything to restart at least the domains, deactivated apache and converting the htaccess files because nothing does not want to work, I can no longer connect even via ssh (timeout error) and after trying them all I got tired to try, so I will follow your advice.

Thanks again and see you soon.
 
Hello. Good afternoon. I have a similar problem. I don't have much knowledge of plesk. Can someone please help me?
I have a cloud server with 32 GB RAM, OS ubuntu 20.04,
ERROR: 1089#0: *26355 upstream timed out (110: Connection timed out) while SSL handshaking to upstream
 

Attachments

  • screenshot_16.png
    screenshot_16.png
    213.7 KB · Views: 17
  • screenshot_15.png
    screenshot_15.png
    126.4 KB · Views: 17
@rayhan Which of the steps described above have you already taken to analyze the problem?
First of all, thank you very much for your answer.
I have looked at it in plesk log. There are where I have encountered these errors. Result when more than 40 people connect on my website the page stops responding. but the server works correctly and I can also access the plesk control panel. here I pass the php configuration of the server.
 

Attachments

  • screenshot_18.png
    screenshot_18.png
    70.5 KB · Views: 55
  • screenshot_17.png
    screenshot_17.png
    112.3 KB · Views: 53
Back
Top