Applicable to:
- Plesk for Linux
Symptoms
-
nginx fails to start with the following error:
CONFIG_TEXT: Cannot assign requested address
-
The error below may appear in the Home page in Plesk:
PLESK_ERROR: New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] bind() to 203.0.113.3:443 failed (99: Cannot assign requested address) nginx: configuration file /etc/nginx/nginx.conf test failed. Detailed error descriptions were sent to you by email. To fix the issue, follow the instructions described in KB: https://support.plesk.com/hc/articles/213933865 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
-
A website may show outdated/old SSL certificate.
Cause
Unsynced IP address between Plesk and OS or IP address was removed/changed manually directly on the server.
For example, the number of IPs registered in Plesk is higher than the actual number of IPs on the server:
-
IP addresses in Plesk:
# plesk bin ipmanage -l
...203.0.113.2...
...203.0.113.3... -
IP addresses on the server:
# ip a
<...>
inet 203.0.113.2/32
Resolution
Sync IP addresses between Plesk and OS:
- Solution for Plesk Obsidian 18.0.35 and later:
- Log into Plesk.
- Go to Tools & Settings > IP Addresses.
- Press the Repair button near the IP address that is marked as broken:
Note: If the IP address that was removed from the server is not required anymore, re-assign domains to a new IP address in accordance with the following article.
-
Go to Tools & Settings > IP Addresses.
-
Press the Reread IP button:
-
If some IP addresses are marked as broken, either click on the Repair button to fix them or click on the Remove button if they are no longer required.
-
Connect to the server via SSH.
-
Re-enable nginx service:
# /usr/local/psa/admin/bin/nginxmng -d
# /usr/local/psa/admin/bin/nginxmng -e
Note: This operation can cause a significant downtime when more than 100 domains are hosted on the Plesk server, as all the configuration files will be regenerated.
-
Connect to the server via SSH.
-
Reread IPs in Plesk:
# plesk bin ipmanage --reread
-
Check IP addresses state:
# plesk bin ipmanage -l
State Type IP Clients Hosting PublicIP
0 S enp0s5:203.0.113.2/255.255.0.0 0 0
1 E enp0s5:203.0.113.3/255.255.255.255 0 1Note: State 0 means the IP address is ok, state 1 means the IP address is broken
-
Repair broken IP addresses with state 1:
# plesk bin ipmanage --repair 203.0.113.3
-
Connect to the server via SSH.
-
Reread IPs in Plesk:
# plesk bin ipmanage --reread
-
Check IP addresses state:
# plesk bin ipmanage -l
State Type IP Clients Hosting PublicIP
0 S enp0s5:203.0.113.2/255.255.0.0 0 0
1 E enp0s5:203.0.113.3/255.255.255.255 0 1Note: State 0 means the IP address is ok, state 1 means the IP address is broken
-
Repair broken IP addresses with state 1:
# plesk bin ipmanage --repair 203.0.113.3
If the IP address 203.0.113.3 is no longer required, remove it via the command below:
# plesk bin ipmanage --remove 203.0.113.3
-
Re-enable nginx service:
# /usr/local/psa/admin/bin/nginxmng -d
# /usr/local/psa/admin/bin/nginxmng -e
Note: This operation can cause a significant downtime when more than 100 domains are hosted on the Plesk server, as all the configuration files will be regenerated.
Comments
29 comments
I had the same problem . After few days of troubleshooting :
Problem :
Could been a problems with vhosting and nginx construction in certain Linix virtual environnements.
Solution :
Switch NGINX service off and remove NGINX from Plesk .
- Go to 'Tools & Settings' , ' Instal and Update Plesk' , 'Add and Remove Product Components',
- Go to 'Web hosting' , (push on ¨'+') ,
- 'Nginx web server and reverse proxy server' , and select 'REMOVE'
Fixed :
nginx settings are removed from Plesk and no other errors seen .
Vhosting problem also fixed (causesd by uncompleted nginx rules )
( work now under Apache HTTPD service and works 100% )
Problem not with Plesk but with the Virtual Machine Environnement he is working in .
You can later 'install' 'Nginx web server and reverse proxy server' in Plesk back if needed .
Version :
Plesk Version 17.0.17 Update #52 ( upgrades and updates same problems )
Hello @Mark,
Thank you for the feedback.
In your case by removing Nginx you have regenerated Apache configuration.
The same may be achieved by just disabling Nginx using the command:
/usr/local/psa/admin/bin/nginxmng -d
After that to enable Nginx again (the configuration of Nginx will be regenerated) use the command:
/usr/local/psa/admin/bin/nginxmng -e
The only way I can run my Apache is without Nginx. There is no way, that I can get it running Plesk always says, that it can't be enabled because two IP addresses. One, the secondary IPV4 I have removed for the moment, but the IPV6 I can't remove as I always get the error message, that it is the last IP address for the interface. What is wrong as IPV4 and IPV6 are both configured on the same interface.
I have tried to reinstall Nginx several times, to no use at all. The error message is always the same and it messes up Apache totally as websites (not using Nginx) vanish and only a message page comes up saying that the debian server is newly configured and the website haven't set up by now.
Deinstalling Ngionx at least brings back everything as it was before, but that way I'm not able to install HTML/2.
I made a full update before I tried to Nginx again to enable HTML/2. I'm using Plesk for several years now, but Nginx never worked. If I was able to start it (in older versions) it crashes websites often, overloaded the server or killed Apache. Now I decided to give it a try again and it seems to be still the same rubbish program as before.
Hello Andreas,
I recommend contacting our technical support for a proper investigation and assistance: https://support.plesk.com/
I tried that before, but they turned me down, because my license isn't directly by Plesk. It's via the provider of my dedicated server. They say I need to contact their support.
So I'm forced to find a solution by my own somehow. I have absolutely no clue or idea as the error message is absolutely idiotic, as I removed the IP V6 from everything. I just can't uninstall it and I'm not willing to fully reinstall my server just to get rid of the IP V6 address, activate NGinx and then get in trouble again, when I activate it again or the secondary V4 address, as the provider of the server know shit about Plesk.
But thanks anyway.
Hello @Andreas,
According to the agreement between Plesk and our partners in such cases support should be provided by partners. They are well-trained and should provide support on their own.
It is also possible to receive support even with such type of license, use this instruction.
We found the IP Address Banning service included the server IP and banned it. We Move to Trusted IPs and the problem its done.
Hello @Ion Iacob,
Thank you for bringing our attention to this!
I am sure other users will find this information helpful
Still I have these logs:
systemd[1]: Starting Startup script for nginx service...
nginx[1156]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx[1156]: nginx: [emerg] bind() to 10.40.42.1:443 failed (99: Cannot assign requested address)
nginx[1156]: nginx: configuration file /etc/nginx/nginx.conf test failed
systemd[1]: nginx.service: Control process exited, code=exited status=1
systemd[1]: Failed to start Startup script for nginx service.
systemd[1]: nginx.service: Unit entered failed state.
The IP is a TUN interface 10.40.42.1 use by OpenVPN. I think plesk adds this by default in the nginx.conf listen interfaces.
Can this be solved somehow?
Hello @Andy B,
This behavior is caused by a known Plesk bug with ID PPPM-7965.
You may find the workaround in this article.
Also, click "follow" to be notified when the issue will be fixed.
Ok, that seems like a better solution that I have applied. Thanks for the feedback!
@Andy B,
You're welcome=)
Assuming I have done all the above steps and the problem persists? All websites are down, I have to log in re-read the IPs, repair them and then it works for some time. What's the issue here?
@Ingo
Plesk does not manage networking, so it is unlikely caused by a product. Recently there was similar problem report caused by the fact one of the IP addresses was issued by DHCP and was not properly renewed. If it is your case - you may want to get in touch with hosting provider and adjust that. If not I'd recommend to create a ticket to check the issue.
This problem is caused on every plesk installation that has also OpenVpn Access Server(https://openvpn.net/vpn-server/) Installed.
I tried to solve it with this article(https://support.plesk.com/hc/en-us/articles/360000811873) but it doesn't work. After the restart the network interface is not available anymore for the openvpnas server, so it fails to run.
The only solution that works so far is to retry or delay the nginxs start-up script, but this is also not a bullet-proof solution.
Anyway, due to updates on pleks and linux, this is an unsolved re-occuring problem.
Any ideas are welcomed.
Andy, please try to ban IP address from VPN using panel.ini file:
https://support.plesk.com/hc/en-us/articles/360001505554-How-to-hide-IP-addresses-in-Plesk-
This should block IP being added to Plesk, and as a result to Nginx configuration files.After you blocked, make sure IP is not under Tools & settings > IP addresses.
If I do this, yes the IP gets blacklisted, but the openvpnas service doesn't start well anymore.
The OpenVpnAs service is started but network interface is not present for some reason. I will create another request for this, as it seems to be a related but different topic.
If one installs OpenVpnAs(https://openvpn.net/vpn-server/) on a Plesk installation there is a problem on server reboot.
Openvpn creates a network interface and that IP is read by Plesk in the ip list. All vhosts are configured also with this IP(which is not a good thing). Normally, the web-server should not listen on this interface.
On a server reboot the network interface is not ready yet and nginx fails to start. This leads to this issue: https://support.plesk.com/hc/en-us/articles/213933865?page=1#comment_360000795999
If one blacklists the IP address in panel.ini settings, nginx starts, but then (for some reason I don't know) openvpnas doesn't create the network interface and openvpn doesn't work.
As a solution:
- blacklist all openvpn ips
- start openvpnas service after psa.service
This causes a mess with every new installation. Any other/better ideas are welcomed.
I am also running into these problems. I'm quite new to plesk and everything. But I was wondering... do I really need the OpenVpn? Because I don't know if I am using it. I dont think so actually. It looks like it was installed by default or something. Could it work for me if I simply remove OpenVpn? Any thoughts on this
Walter Jansen If you are logging into Plesk without this extensions then you can remove it in Plesk > Extensions.
Crosspost from "https://support.plesk.com/hc/en-us/articles/213944465"
This didn't helped me, but I was able to "fix" it for now:
For some reason, Plesk did a "Reread" at some point and found my docker interfaces/IPs... This was causing my problems.
For now, I removed the docker interface, and then the IP under Plesk > Tools & Settings > IP Addresses
Hi,
is there any possibility to that via command line? At the moment I can't access my plesk interface at all and this is one of two errors i get.
Hi Connor,
did you try:
https://support.plesk.com/hc/en-us/articles/115004816993-Unable-to-remove-an-IP-address-via-Plesk-IP-address-203-0-113-2-cannot-be-removed-because-it-is-used-by-DNS-zone-of-one-or-more-domains#:~:text=In%20Plesk%2C%20go%20to,for%20the%20process%20to%20complete.
Scroll down to: Removing the IP address manually via a command-line interface
Tank you very much, this is exactly what i was looking for
This solves absolutely nothing. The IP address of the server was changed and this error started to appear. However, the solution here solves absolutely nothing.
Andreas Sundgren
In that case you should probably change the IP for all your subscriptions:
https://support.plesk.com/hc/en-us/articles/213372029-How-to-switch-IP-address-for-domain-in-Plesk-
I had the problem, because of deprecated Docker network. Removing the IP solved the problem.
We had a similiar issues. Where sometimes nginx would not start at boot with the same error message as the op.
The ip-address was the correct address though. But there was no dhcp ack for the ip-adress, while systemd already said target network is online.
I solved this quick & dirty by adding a 5 second sleep to nginx startup for now.
Hello Rick,
Thank you for your comment. Indeed, a similar issue may appear when a delay in assigning of an IP address to a network interface occurs. For example, because of a delayed response from the DHCP server. This issue is described in another article. You may refer to it for details: https://support.plesk.com/hc/en-us/articles/213908925.
Please sign in to leave a comment.