500 error; "A valid database connection could not be made"1.4.4 after update
-
Also to notate, apache is running fine with no errors and tested. I’ve checked every available post, issue/resolution, wiki page there is and nothing has helped me resolve this. Let me know what you guys need to see and i"ll gladly provide it. Thank you!
-
@stepkinetic said in 500 error; "A valid database connection could not be made"1.4.4 after update:
redirects to the correct URL but gives an internal 500 error.
A 500 HTTP response should give you an error in the apache logs!! See my signature on where to find the logs on your server and post the latest log messages here in the forums!
Other than that you can create a PHP info page just to see if Apache and PHP do work together nicely. Create a file
/var/www/fog/info.php
with contents:<?php phpinfo(); ?>
Save file and open in your browser http://x.x.x.x/fog/info.php
… https://<MY IP HERE>/fog/service/getversion.php …
Are you sure you’ve set things up for HTTPS properly???
-
[Mon Nov 20 14:38:28.136580 2017] [:error] [pid 8805] [client <MY IP>:58598] PHP Fatal error: Call to a member function lastInsertId() on boolean in /var/www/html/fog/lib/db/pdodb.class.php on line 443
[Mon Nov 20 14:50:45.430938 2017] [mpm_prefork:notice] [pid 8795] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Nov 20 14:53:43.658802 2017] [suexec:notice] [pid 965] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Nov 20 14:53:43.711752 2017] [auth_digest:notice] [pid 965] AH01757: generating secret for digest authentication …
[Mon Nov 20 14:53:43.712556 2017] [lbmethod_heartbeat:notice] [pid 965] AH02282: No slotmem from mod_heartmonitor
[Mon Nov 20 14:53:43.828586 2017] [mpm_prefork:notice] [pid 965] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.32 configured – resuming normal operations
[Mon Nov 20 14:53:43.828619 2017] [core:notice] [pid 965] AH00094: Command line: ‘/usr/sbin/httpd -D FOREGROUND’PHP Fatal Error is the only thing I see.
-
@stepkinetic said in 500 error; "A valid database connection could not be made"1.4.4 after update:
PHP Fatal error: Call to a member function lastInsertId() on
Well this is usually a clear sign for mysql credentials not being correct!
-
@stepkinetic Do you have special characters like
'
or"
or space in your password? -
I’ve tested mysql -u root -p<mypwd> fog successfully. Would there be another place to check a config file? I have looked at /opt/fog/.fogsettings and all looks good there
-
@stepkinetic Take a look at
/var/www/fog/lib/fog/config.class.php
! -
Yes actually I have a * and i noticed in the config file it puts a \ before it, which I wasn’t sure if it should be there. I know that linux will put that character before an asterisks to notate it as a character and not a variable. I believe that’s correct, anyways lol.
-
@stepkinetic So I guess you were able to fix this by editing
config.class.php
by hand… Yeah escaping is very important but it can cause issues as well. Sorry for that. -
Holy hell that’s what it was…extra character in mysql credentials. Thank you so much for drawing my attention to that.
-
@stepkinetic You are welcome! Marking this solved…