• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Fog crash. Database connection unavailable?

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    4
    18
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sebastian Roth Moderator
      last edited by

      @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 try systemctl status mysql)

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      J 2 Replies Last reply Reply Quote 0
      • J
        JohnB
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • J
          JohnB @Sebastian Roth
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @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)

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 0
            • J
              JohnB @Sebastian Roth
              last edited by

              @Sebastian-Roth It lets me in.

              1 Reply Last reply Reply Quote 0
              • S
                Sebastian Roth Moderator
                last edited by

                @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.

                Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                J 1 Reply Last reply Reply Quote 0
                • J
                  JohnB @Sebastian Roth
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sebastian Roth Moderator
                    last edited by

                    @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', '');
                    ...
                    

                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                    J 1 Reply Last reply Reply Quote 0
                    • J
                      JohnB @Sebastian Roth
                      last edited by

                      @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

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sebastian Roth Moderator
                        last edited by

                        @JohnB And what about ls -al /var/www/html/fog/lib/fog/c*?

                        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by

                          @JohnB As well, do you have that file? ls -al /opt/fog/.fogsettings (the dot in front of the filename is intended!)

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          J 1 Reply Last reply Reply Quote 0
                          • J
                            JohnB @Sebastian Roth
                            last edited by

                            @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?

                            1 Reply Last reply Reply Quote 0
                            • S
                              Sebastian Roth Moderator
                              last edited by

                              @JohnB See the chat bubble in the top right corner.

                              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                              1 Reply Last reply Reply Quote 0
                              • ***Redbob*
                                ***Redbob
                                last edited by

                                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.

                                1 Reply Last reply Reply Quote 0
                                • george1421G
                                  george1421 Moderator @JohnB
                                  last edited by george1421

                                  @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.

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    Sebastian Roth Moderator
                                    last edited by

                                    @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.

                                    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                    george1421G 1 Reply Last reply Reply Quote 0
                                    • george1421G
                                      george1421 Moderator @Sebastian Roth
                                      last edited by george1421

                                      @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.

                                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                      1 Reply Last reply Reply Quote 0
                                      • 1 / 1
                                      • First post
                                        Last post

                                      223

                                      Online

                                      12.1k

                                      Users

                                      17.3k

                                      Topics

                                      155.4k

                                      Posts
                                      Copyright © 2012-2024 FOG Project