Nextcloud, Technology, Tutorial

Fixing My Dead Nextcloudpi box in three simple steps

My nextcloudpi box was kicking back errors and wouldn’t start. It was in a degraded state. I then learned about systemctl --failed command which showed something wrong with certbot. Thankfully I already knew that was related to LetsEncrypt.

I realized that it was trying to renew two domains that weren’t there and were expired and would be unable to renew anyway even if they tried so… not sure why they were there in the first place other than perhaps some testing I did a long time ago? So I wanted to remove them completely to rule them out so here are the instructions for anyone else trying the same thing on Nextcloudpi or another server with ‘random letsencrypt domains’

Part 1 – Removing Random LetsEncrypt Domains and Certificates

Should be as simple as running these commands and replacing with your domain verbatim.

  1. sudo rm -rf /etc/letsencrypt/archive/
  2. sudo rm -rf /etc/letsencrypt/live/
  3. sudo rm -rf /etc/letsencrypt/renewal/

Part 2 – Disabling the Deleted Site from Apache’s Reach

After doing Part 1 above and removing these random domains that should not have been there I ran sudo systemctl restart certbot.service to restart the certbot service. This seemed to work now. However, when I ran sudo systemctl status it still did not show a green light.

After digging deeper by running a sudo journalctl -xe command the log showed here was a syntax error in /etc/apache2/sites-enabled/000-default.conf. After going to line 43 I realized that it was trying to run one of the domains I had deleted in Part 1 above. Thankfully I already knew how to enable and disable apache sites.

to do that I did:

sudo a2dissite 000-default.conf

Then I did a:

sudo systemctl restart apache2.service

Then I did another check on services:

sudo systemctl status

Nice, the apache stuff now seems fixed but…

Part 3 – Fixing some Wifi-Country.service Error Thing

I still have another error which the system seems not willing to go around! Why? Why me? haha

wifi-country.service loaded failed failed Disable WiFi if country not set

So then I found this blog where i pasted the following to the bottom of the file

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Full disclaimer: I have absolutely no idea what this stuff above does, so yeah – copy and paste at your own risk like I did!

There weren’t any instructions to restart a service which I expected. And, as expect, it was still dead. Thankfully my guess was correct and there should have been a service restart command as follows:

sudo systemctl restart wifi-country.service

That seemed to work…

Then I ran sudo systemctl status and everything looked running. Yay!

Then BOOM! System back. Nextcloudpi started syncing again.

I have no idea why things went bad but it’s a good day when you can fix it indeed! Usually doesn’t go this well for me but I guess I”m learning a few things so let’s keep suffering for growth shall we?

Have a good day!

Tagged , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *