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

    "A valid database connection could not be made"

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    4
    8
    2.8k
    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.
    • J
      Joe Bishop
      last edited by

      Server
      • FOG Version: 1.3.0
      • OS: Ubuntu 16.04 Storage nodes 14.04
      Client
      • Service Version:
      • OS:
      Description

      All of my storage nodes have “A valid database connection could not be made” on the FOG Version Information page, and well as on the dashboard. As far as I can tell everything else is working, just wanted to know if there was a way to fix this.

      Server
      • FOG Version:
      • OS:
      Client
      • Service Version:
      • OS:
      Description
      Server
      • FOG Version: 1.3.0
      • OS: Ubuntu 16.04 Storage nodes 14.04
      Client
      • Service Version:
      • OS:
      Description

      All of my storage nodes have “A valid database connection could not be made” on the FOG Version Information page, and well as on the dashboard. As far as I can tell everything else is working, just wanted to know if there was a way to fix this.

      1 Reply Last reply Reply Quote 0
      • Wayne WorkmanW
        Wayne Workman @Joe Bishop
        last edited by Wayne Workman

        @Joe-Bishop said in "A valid database connection could not be made":

        When these servers were all 1.2.0 they were fine.

        That’s code for “I’m very frustrated and blame the upgrade”. I don’t blame you. 🙂
        However something’s amuck. If the passwords all match up and you followed my below steps, it’s time to troubleshoot the remote connection.

        Log into one of your fog storage nodes (ssh) and from that box, try to connect to the main server’s fog DB. Here’s how to do that:
        mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog

        Note that there isn’t a space between -p and PasswordHere this is intentional. The username is fogstorage and the x.x.x.x is the main fog server’s IP address. the password is the FOG_STORAGENODE_MYSQLPASS described below.

        Now, one of a few things will happen. You’ll get in (that would be bad, means there’s some other crazy problem) or you’ll get access denied (probably password issue) or you’ll get no response or a timeout or something else (probably no remote access enabled).

        This troubleshooting step and others are here:
        https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL

        If it doesn’t work, you might try granting the fogstorage user full control over the fog database and also granting it remote access too (Steps are in the above article). Then try the test above again until it works.

        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!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        J 1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          Typically this means the “central” server is not setup properly.

          Mind hitting me up in chat, and possibly running a teamviewer session?

          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! Get in contact with me (chat bubble in the top right corner) if you want to join 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
          • Wayne WorkmanW
            Wayne Workman
            last edited by

            I know Tom offered a TV session, but I want to explain more fully the issue and how to solve it. Both for the original poster and for future readers.

            FOG storage nodes communicate with the main fog server via remote MySQL calls. The main fog server will have an account setup for remote access already, this is done by the fog 1.3.0 installer automatically when it’s run. This account is called fogstorage and it’s password is randomly generated during install time. The below link details where to find this password along with a slue of other information as well should you be interested in reading it.
            https://wiki.fogproject.org/wiki/index.php?title=Password_Central
            The location of the password is here for FOG 1.3.0:
            Web Interface -> FOG Configuration -> FOG Settings -> FOG Storage Nodes -> FOG_STORAGENODE_MYSQLPASS

            When freshly installing a FOG Storage node, the credentials found in the above area are what you would input for the MySQL credentials. fogstorage is already the default. When asked for the password, just copy/paste it into the prompt and continue.

            For those that already had FOG Storage nodes setup, you’ll need to just edit the /opt/fog/.fogsettings file on the storage nodes and change the snmysql settings you find in there. The above password article details these, but you’d plug in the main fog server’s name or IP, the user account (usually fogstorage) and the password found in the above field. After making these changes, you’re not done. Simply rerun the fog installer and it’ll take all the settings you’ve set inside of the .fogsettings file and write them into the proper places (also detailed in the above article, config.class.php).

            I understand for someone that is new to this stuff and new to I.T. in general, it might be a lot to take in. Just ask questions if you need help, don’t be shy. Us folks here with tags by our names aren’t paid, we just like helping people with a project we enjoy.

            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!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            J 1 Reply Last reply Reply Quote 0
            • J
              Joe Bishop @Wayne Workman
              last edited by

              @Wayne-Workman I have checked all of the passwords and they all match what they are supposed to be as far as I can tell. When these servers were all 1.2.0 they were fine.

              Wayne WorkmanW 1 Reply Last reply Reply Quote 0
              • Wayne WorkmanW
                Wayne Workman @Joe Bishop
                last edited by Wayne Workman

                @Joe-Bishop said in "A valid database connection could not be made":

                When these servers were all 1.2.0 they were fine.

                That’s code for “I’m very frustrated and blame the upgrade”. I don’t blame you. 🙂
                However something’s amuck. If the passwords all match up and you followed my below steps, it’s time to troubleshoot the remote connection.

                Log into one of your fog storage nodes (ssh) and from that box, try to connect to the main server’s fog DB. Here’s how to do that:
                mysql -u UserNameHere -pPasswordHere -h X.X.X.X -D fog

                Note that there isn’t a space between -p and PasswordHere this is intentional. The username is fogstorage and the x.x.x.x is the main fog server’s IP address. the password is the FOG_STORAGENODE_MYSQLPASS described below.

                Now, one of a few things will happen. You’ll get in (that would be bad, means there’s some other crazy problem) or you’ll get access denied (probably password issue) or you’ll get no response or a timeout or something else (probably no remote access enabled).

                This troubleshooting step and others are here:
                https://wiki.fogproject.org/wiki/index.php?title=Troubleshoot_MySQL

                If it doesn’t work, you might try granting the fogstorage user full control over the fog database and also granting it remote access too (Steps are in the above article). Then try the test above again until it works.

                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!
                Daily Clean Installation Results:
                https://fogtesting.fogproject.us/
                FOG Reporting:
                https://fog-external-reporting-results.fogproject.us/

                J 1 Reply Last reply Reply Quote 0
                • J
                  Joe Bishop @Wayne Workman
                  last edited by

                  @Wayne-Workman Thanks for your help. I think that I have it working now. I had to reset the password for remote access. I was able to access it locally, but not from remote.

                  Wayne WorkmanW 1 Reply Last reply Reply Quote 0
                  • Wayne WorkmanW
                    Wayne Workman @Joe Bishop
                    last edited by

                    @Joe-Bishop Good work. Just remember, if you set it to something other than what’s inside of the FOG_STORAGENODE_MYSQLPASS setting, go ahead and go into FOG Configuration -> FOG Settings -> Storage Nodes and update it there too. That field is not actually used for anything but is just a placeholder for people to easily find out what the installer set the pass to. You should update it if you changed it.

                    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!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    1 Reply Last reply Reply Quote 0
                    • G
                      glucas
                      last edited by glucas

                      Hello,

                      This thread is very well referenced by search engines so I complete it with my experience.

                      I installed a new storage node on my FOG (Debian 8 + 1.5.7) setup (before : web server / central node + two storage nodes, after : web server / central node) + three storage nodes).

                      During the installation, I failed on question “What is the IP address or hostname of the FOG server running the fog database?”. The default value is the storage node itself. The mysql command given by Wayne Workman worked from my new storage node, the problem was on FOG side.

                      I understood my mistake. So, I modified “snmysqlhost” in /opt/fog/.fogsettings with the address of the FOG web server / central node.
                      I restarted the FOG services (systemctl restart FOGSnapinHash FOGImageReplicator FOGImageReplicator FOGImageSize FOGTaskScheduler FOGSnapinReplicator FOGPingHosts FOGMulticastManager).
                      The problem was still here.
                      I rebooted the server.
                      The problem was still here.

                      I executed installfog.sh a second time on my new storage node. It detected the existing installation. It did some stuff and… the new storage node works fine.

                      Regards.

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

                      187

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project