Fog crash. Database connection unavailable?
-
Hello everyone. Our instance of FOG is unreachable after a power outage. We have it sitting in a Debian 9 virtual environment on a server running Windows Server 2012 (Hyper-V). We’ve tried restarting FOG, restarting the server it’s on, rolling back to the previous ‘checkpoint’ in Hyper-V… nothing works. It (Hyper V) says it’s running, and I do get replies to pings. Going to FOG using IP gets me to the folder that should have the dashboard in it (‘Fog’), but trying to open it is the same as using Explorer: ‘database connection unavailable’. I can get into Linux and poke around in FOG, but i have no idea what i should be looking for or doing. Any ideas?
Thanks.
-
@JohnB What kind of Linux do you have? Login and run
lsb_release -a
to get the information.As well you can start by looking into services running properly:
systemctl status mariadb
(or if it says no such service trysystemctl status mysql
) -
Hi Sebastian. It’s Debian GNU/Linux 9.4 (stretch). The systemctl check makes it look like MariaDB is running fine (the main PID is 1941 (mysqld) - I assume that’s ok?) although the status check output does conclude with “Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable”. But this doesn’t sound like a fatal error.
-
@Sebastian-Roth Hi Sebastian. It’s Debian GNU/Linux 9.4 (stretch). The systemctl check makes it look like MariaDB is running fine (the main PID is 1941 (mysqld) - I assume that’s ok?) although the status check output does conclude with “Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable”. But this doesn’t sound like a fatal error.
-
@JohnB Well then try to see if you can connect to the DB:
mysql -u root -p
(just hit enter when asked for the password and see if it fails or lets you in) -
@Sebastian-Roth It lets me in.
-
@JohnB Well then, can you please take a picture/screenshot of the actual error you see (“Database connection unavailable”) so we know where exactly you run into this. Post here.
-
@Sebastian-Roth It’s literally just the text “database connection unavailable” on an otherwise blank (white) screen. This is what I get when I try to go to the FOG admin dashboard (flog.lib.{our institution}.edu/fog), or when I go to FOG by its IP and then try to get into the ‘Fog’ folder.
Thank you very much for your help, btw.
-
@JohnB Well then we need to see if the DB credentials are still set where they should be. See if you have the file
/var/www/html/fog/lib/fog/config.class.php
and if it has content. You should find things like this in there:... define('DATABASE_TYPE', 'mysql'); // mysql or oracle define('DATABASE_HOST', 'localhost'); define('DATABASE_NAME', 'fog'); define('DATABASE_USERNAME', 'root'); define('DATABASE_PASSWORD', ''); ...
-
@Sebastian-Roth There doesn’t seem to be a config.class.php file in there. Here’s what I get when I run ls -a for the /lib/ directory:
. … client db events fog hooks index.php pages plugins reg-task reports router service
-
@JohnB And what about
ls -al /var/www/html/fog/lib/fog/c*
? -
@JohnB As well, do you have that file?
ls -al /opt/fog/.fogsettings
(the dot in front of the filename is intended!) -
@Sebastian-Roth When I list /fog/c*, I get 20 lines, 18 of them PHP files. When I list .fogsettings, I get one file (.fogsettings). What should I be looking for?
-
@JohnB See the chat bubble in the top right corner.
-
I have this problem in FOG every 3 months aproximately. All I just do is to reinstall it and everything turns well, wihout any lose of data or settings.
-
@JohnB From the fog server linux command prompt, lets see if you can get into the database. Key in:
mysql -u root -p fog
At the password prompt key in the enter key. If you can get into the database then we can take the next steps.[edit] there is something funky going on with the forum. This thread was presented to me being 19 hours old with no response by anyone. So I answered with this post, now I see there was an ongoing conversation with other responses. That is very strange. I thought how did I miss this post for 19 hours, especially with no one responding.
-
@Redbob @george1421 Different issue here. Got this up again in a remote session. DB is nicely setup on another host and that needed a restart. Not sure what exactly was hung up, but a quick reboot of the DB server solved the issue.
-
@Sebastian-Roth Yeah, I just added an edit section to my previous post. This thread popped up with no responses after 19 hours. I didn’t understand how I missed this for 19 hours that’s why my response was a bit random, I was starting at the beginning. Very strange.