I broke everything... and had to fix it all

So a few nights ago I decided to update my NextCloud instance. The update went mostly well, thankfully NextCloud's updater is pretty straight forward and automatic; however what I didn't realize was that updating was going to put me in a login loop.

Everyone I tried to login I got redirected to

.com/login?redirect_url=/apps/files/

If I didn't get redirected then I'd get a server maintenance error saying that NextCloud couldn't reach the MariaDB backend.

I logged into my Portainer and tried to reboot NextCloud and MariaDB but was given an error saying there was no more room on the disk. Apparently Watchtower had been running rampant and not cleaning up after itself when it updated containers.

I SSH'd into my server and run a

sudo docker system prune 

to clean up the left overs from Watchtower. If you've never used Docker Prune before it's supposed to only clean up Docker resources that aren't in use but in my case it obliterated my Letsencrypt container.

To add to this my NAS no longer saw the HDD that had all the Docker containers on it. Several reboots and mounting/unmountings later and OMV saw the HDD again. 

Now to set up the letsencrypt container again. Thankfully there was no data loss so all the Nginx proxies were still configured and I wrote a guide on how to set up Letsencrypt. 

When I got the letsencrypt container set back up I discovered I couldn't access and of my websites. They were giving me a 502 bad gateway. It took me a few minutes to realize that was because I didn't have the Docker container set to the right network.

Finally after about 2 hours I had letsencrypt set up and working, but my NextCloud was still giving me a redirect loop.

Turns out all I needed to do was reset the permissions on NextCloud and database folders. 

Comments