"A valid database connection could not be made"
-
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.
-
@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
andPasswordHere
this is intentional. The username isfogstorage
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_MySQLIf 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. -
Typically this means the “central” server is not setup properly.
Mind hitting me up in chat, and possibly running a teamviewer session?
-
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 thesnmysql
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.
-
@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.
-
@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
andPasswordHere
this is intentional. The username isfogstorage
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_MySQLIf 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. -
@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.
-
@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.
-
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.