Problem Statement:#
After an update of the VPS
server using apt update && apt upgrade
nothing worked. All my sites return a 502 bad network error when accessed via the browser.
These are the steps I took to get it up and running again.
Login in using SSH.#
Check that the docker images are running. This wasn’t the problem.
Open port 81 on the Linode
to allow http access to the nginx server admin, by adding a firewall accept-inbound-http rule. This allowed me to access the nginx-proxy-manager
http site.
All settings host settings were saved, but IP addresses may not be correct to newly restarted Portainer
?
Next step?#
Get Portainer
up and running to be able to see what ports and IP’s are being used for the various containers.
The portainer HTTP port 8000 was also blocked via linode
firewall rules.
Change this.
Upon entering portainer
we can see the IP addresses have been reset and no longer correspond to the settings of the proxy hosts in nginx proxy manager.
Options#
Two options, reset and possibly re-issue the letsencrpt
certificates or attempt to assign network IP addresses in the individual docker-compose files of each container.
Let’s try option two to avoid similar problems when we reboot, or update and upgrade the linode
server.
The snippet for docker-compose.yml
I found to hardcode the IP address was similar to the following:
ipv4_address: 172.20.0.X
Goal#
Focusing on the goal, I decided to get all the sites up and available as a first priority, by editing the proxy host IP’s to match those in portainer
.
That worked. The letsencrypt
certificated didn’t need to be updated or regenerated.
Now to experiment with the streamlit example
container to use a fixed IP address on the subnet.
This has been sidelined for the moment, as my goal today was to setup CI/CD
on my VPS
, but I broke the site by updating the server. The hardcoding of portainer
assigned IPs is going to be added to my “nice to do” #TODO list for now.