Mariadb not starting - causing Nextcloud to Error 500 Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
User avatar
Rilic
Posts: 42
Joined: Thu May 07, 2020 4:14 pm

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Rilic »

Oooooh nooooo. This is really bad, cuz my Gitea instance isn't loading because of it either.
Uh, I don't know if there are any database backups, or at least I don't know where they'd be saved (yeah, I know, no backups = dumb). If it makes any difference, I did very recently upgrade Nextcloud to the latest version. Do you think that might have something to do with it and provide clues as to what happened in some logs anywhere?

Also, is there a way to fix the database before I move on with any deeper repairs? I looked around and apparently I could use mysqlcheck. Would that be safe in this instance?
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Joulinar »

First thing before doing anything, create a backup/copy of your database directory. If thinks goes wrong (even more worse than they are already ;) ) you are able to copy data back.

Code: Select all

/mnt/f28f98de-752b-4d8c-81d2-982c7b5f037b/dietpi_userdata/mysql
An option is to post your error.log on a MariaDB specialised board. Maybe there are experts who are more knowledgeable than I on fixing such deep database related issues.

https://mariadb.com/kb/en/community/+questions/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Rilic
Posts: 42
Joined: Thu May 07, 2020 4:14 pm

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Rilic »

So I looked around and I think I'm just gonna redeploy the apps and recreate the database. Do you know a quick way of doing that while keeping the old data from their dietpi-userdata folders, even with the database gone?
Thanks
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Joulinar »

You could try to run dietpi-software reinstall 114. It should force a re-installation of NextCloud and all related software packages. But I'm not sure if this will work with a corrupted database. Therefore it might be good to backup all your data from /mnt/dietpi_userdata/nextcloud_data first. In worst case, you would need to uninstall and install NextCloud completely. If the NextCloud DB would need to be reinstalled from scratch, you will loos the link between NextCloud and the data on OS layer. Even if data are still exist on OS layer, NextCloud will not be able to display them. But it should be possible to get the data back displayed by running ncc files:scan --all
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Rilic
Posts: 42
Joined: Thu May 07, 2020 4:14 pm

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Rilic »

Sounds good! What about the Gitea instance, though? It seems like it also uses the corrupt database and won't work without it. Will that be fine if I recreate the database and use the same dietpi_userdata folder, or?
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Joulinar »

honestly I don't have much experience on Gitea and how it's working.

Usually you could use Gitea Backup/Restore function but I guess this will not work due to the corrupted database.

https://docs.gitea.io/en-us/backup-and-restore/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Rilic
Posts: 42
Joined: Thu May 07, 2020 4:14 pm

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Rilic »

I've tried reinstalling nextcloud, but it gave me the same error during the launch of mariadb, even after it was reinstalled.
Do I need to delete the old database in order for this to work? I'm prepared to just restart gitea/nextcloud from scratch if I have to.
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Joulinar »

Probably it it would be needed to run a complete uninstall, da a reboot and a new installation to set it up from scratch.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Rilic
Posts: 42
Joined: Thu May 07, 2020 4:14 pm

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Rilic »

I know this isn't quite on topic of this thread but since I'm already replying on it:
I've simply re-flashed the dietpi distro as I can afford to just redeploy everything - I'm the only user :P. However, I can't seem to stop pihole from being accessible from my external domain. The 99-dietpi-pihole-block_public_admin.conf file is in the /etc/lighttpd/conf-enabled folder and i've enabled the lighty mod, so I don't quite know what's going on. There are no errors being thrown by the lighttpd syntax checker, either, and it's being loaded.
Any quick solution to this, or?

EDIT: Found my own solution! I put my main website in a subfolder in /var/www and set lighttpd to change the document root to that subfolder based on the domain. Did the same for nextcloud, too, with my own tweaks and a subdomain. Looks very slick!
User avatar
Joulinar
Posts: 2085
Joined: Sat Nov 16, 2019 12:49 am

Re: Mariadb not starting - causing Nextcloud to Error 500

Post by Joulinar »

hmm that's strange. I just checked it on a VM and it is working well. Pihole Admin page was not reachable from internet. I just got 403 Forbidden

Can you do

Code: Select all

lighty-enable-mod dietpi-pihole-block_public_admin
service lighttpd force-reload
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply