SOLVED Unable to use log viewer from interface

  • When I try to load the “Log Viewer” page, I’m greeted with a “There are no enabled storage nodes for this group” page.

    Apache error log is insanely large as I’m getting:

    [Thu Oct 15 18:49:51.394280 2015] [:error] [pid 1043] [client] PHP Warning: mysqli::query(): Couldn’t fetch mysqli in /var/www/html/fog/lib/db/MySQL.class.php on line 64.

    for just about every host it looks like (I’ve got close to 600 so far).

  • @Tom-Elliott Almost there actually…The errors mentioned are no longer present; however all nodes show options like server (ie. Multicast,Image/Snapin Replication etc.) and all present “no data to read” when chosen.

    Thanks for the hard work, I’ve mentioned it before, but I feel it needs said again. I really appreciate your help.

  • Senior Developer

    This should now be fixed. Sorry it took so long.

  • Ok so the issue is with “MYSQL not currently running” is somehow fixed, must’'ve been resetting the fogstorage password. Not sure why SVN 4972 nodes weren’t affected.

    However the issus with a page popping up with “There are no enabled storage nodes for this group” when clicking “Log Viewer” still exists. I’m currently running SVN 5036.

  • @Tom-Elliott What should I get when I enter it correctly :mysql -u fogstorage -p’fs*********’ -h fog

  • @Hanz Server shows the following using fog database.

    MariaDB [fog]> show grants FOR fogstorage;
    | Grants for fogstorage@% |
    | GRANT USAGE ON . TO ‘fogstorage’@’%’ IDENTIFIED BY PASSWORD ‘2690302A44883E0B71599B2B3D4687A11E9D4A6A’ |
    TO ‘fogstorage’@’%’ |
    2 rows in set (0.00 sec)

    I know the password is encrypted, but it is certainly correct via the WebUI

  • @Hanz sry I didn’t c that last part…I’ve been doing it wrong apparently…will test.

    mysql -u fogstorage -p’fogstorage password’ -h fog yields

    ERROR 1045 (28000): Access denied for user ‘fogstorage’@‘’ (using password: YES)

  • @Tom-Elliott Yes I’ve made sure the fogstorage password is correct on server as well as nodes. This problem didn’t arise until I updated to from version 4972…I don’t understand how any setting I have could affect this. I’ve also tried to manually assign privileges to the db on server by issuing (grant all privileges on fog.* to fogstorage@’%’ identified by ‘(fogstorage password)’

  • Senior Developer

    @Hanz change the command so the -p is blank and enter the password when it prompts for the password. Otherwise it’s trying to connect to a database named whatever your password is. If you want the password inline do NOT put a space between the -p and wrap the password in quotes. For example mysql -u fogstorage -p'fogstoragepassgere' -h fog

  • Senior Developer

    The fogstorage user for MySQL ALWAYS requires a password. This password is randomly created by the installer and is issued when the db is instantiated. You can define this yourself of course. It is created with fogstorage@’%’ meaning anybody can access this user regardless of the ip it’s coming from. % is MySQL is a wildcard character. The password that is created for this user is stored in fog configuration->fog settings->storage user ->password or very close to that direction.

  • @Uncle-Frank I typed it wrong, but all nodes show same error
    ERROR 1045 (28000): Access denied for user ‘fogstorage’@‘XXX.XXX.XXX.XXX’ (using password: NO)

  • Senior Developer

    But or should it be ???

  • They are different versions, because I updated the two nodes when the error started presenting itself.

  • @Uncle-Frank yes, this ip is one of the storage nodes and the 3.50 is my server. I was trying to connect to db on server manually, from the node.

  • Senior Developer

    @Uncle-Frank I actually removed the async code as it was rather pointless to have. This is why those lines of code are removed. I’ve switched from async query to a prepare/execute/get_result.

    I removed the async code for a few reasons.

    1. It only ever operated on a single MySQL instance. Essentially there was absolutely no point in using async as we always had to wait for the single sql call to return data anyway.

    2. Potential timing issues. Basically, it helps limit potential for a 0 id to return in that by the time the data was inserted it wouldn’t have been able to receive the id that was inserted this leaving it as 0 while in reality it just hadn’t returned by the time the insert code was referenced.

    3. Prepared statements, while not currently setup properly, limit potential of sql injection attempts. While I am sanitizing input and output a great deal even without prepared statements, I think it helps better reduce the potential in case I missed something earlier in the scripts.

  • Senior Developer

    @Hanz said:

    ERROR 2003 (HY000): Can’t connect to MySQL server on ‘’ (113 “No route to host”)

    Maybe this is just a typo but the IP address is quiet different to all the others you mentioned here in this thread so far (10.7. instead of 10.72.). This could explain the “No route to host” error.

    ERROR 1045 (28000): Access denied for user ‘fogstorage’@‘’ (using password: NO)

    Are you sure about using an empty or no password here? Make sure the login credentials are correct in /var/www/html/fog/lib/fog/Config.class.php

    They two nodes not working correctly are also missing the connection type= “MYSQL_ASYNC” line in /opt/fog/.fogsettings and line can’t be manually added, installer overwrites somehow.

    This file is only used/written by the installer script. FOG itself uses the above mentioned Config.class.php when connecting to the database. The MYSQLI_ASYNC setting missing on those two nodes might mean that the version checked out is older?? Edit: According to what Tom said the ASYNC stuff might be missing in a newer version. Please check to see if you are running different versions (it’s not a real problem I think - but it would explain the missing setting):

    cd /path/to/fog/trunk
    svn info
    Revision: xxxx

  • @Uncle-Frank No the problem is still present, and I the apache error log is throwing in lin 29 of /var/www/html/fog/lib/db/MySQL.class.php…which mentions the DATABASE_HOST, USERNAME ,AND PASSWORD…

    The nodes that are working correctly as far as the main page not saying “MYSQL server not currently running” in place of the kernel ver.,
    ERROR 1045 (28000): Access denied for user ‘fogstorage’@‘’ (using password: NO) when trying to connect manually to db.
    This is error msg. for two stating that “MYSQL server not currently running”
    ERROR 2003 (HY000): Can’t connect to MySQL server on ‘’ (113 “No route to host”)

    They two nodes not working correctly are also missing the connection type= “MYSQL_ASYNC” line in /opt/fog/.fogsettings and line can’t be manually added, installer overwrites somehow.

  • Senior Developer

    Is this issue solved?

  • @Tom-Elliott I had him try your idea.

    I can’t find the post… 😕 but,

    You suggested installing FOG in normal mode on all storage nodes, and then editing /opt/fog/.fogsettings to point to the real master’s DB (mysql host, username, and password). I also instructed him to enable remote access to MySQL. He did these things, and it worked on all of his nodes except for one… and this one node was the one that had pre-existing problems as well.

  • I would like to add that although the other two nodes (that are still running 4972) don’t have the MYSQL error on Main Page, but also can’t connect manually to db.