MySQL errors in apache error log file with 1.2.0



  • Server
    • FOG Version: 1.2.0 (installed about 2 years ago, no updates)
    • OS: Debian 7.6
    Client
    • Service Version: 0.1
    • OS: Windows Server 2012 R2/Windows 7 Pro/Windows 10 Pro
    Description

    In the process of trying to fix an unrelated issue, I seem to have caused a problem with the FOG Client. Every time it checks in to the server I get these errors in the apache error log file below (all clients cause this error to be logged to the file). Looking through the MySQL troubleshooting wiki, I am able to connect with the following command:

    mysql -u fogstorage -p***** -D fog

    The fogstorage username and password are the ones in the FOG Storage Nodes section of the FOG System Settings section in the FOG Configuration page. My clients are able to up/download and they reboot when a job is pending. I just would like to fix this issue since I don’t know what the ramifications are. Any ideas?

    [Wed Oct 05 06:17:47 2016] [error] [client 10.30.0.147] PHP Warning: mysqli::mysqli(): (HY000/2002): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /var/www/fog/lib/db/MySQL.class.php on line 64
    [Wed Oct 05 06:17:47 2016] [error] [client 10.30.0.147] PHP Warning: mysqli::select_db(): Couldn’t fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 165
    [Wed Oct 05 06:17:47 2016] [error] [client 10.30.0.147] PHP Warning: mysqli::query(): Couldn’t fetch mysqli in /var/www/fog/lib/db/MySQL.class.php on line 89
    .
    .
    .

    Thanks,
    Dave.


  • Senior Developer

    @Dave-Wolf If I’m not mistaken, you’re using ubuntu?

    If i had to guess, mysql started before networking was ready, so you’re kind of in a “stale” state for the mysql process.

    Try simply running:

    sudo service mysql stop

    It will most likely come back with failure to find running process…

    Then run:
    sudo service mysql start and all should start working from the MySQL standpoint.



  • @Tom-Elliott - In looking at the error file again; I don’t see any more errors logged since the system booted this morning at 6:17. Perhaps clients were checking in after apache had been initialized, but before the mysql server was running, resulting in the errors? I hadn’t seen them in the logs before, but our FOG server has been running months at a time without rebooting, until the memory issue I was having with php caused me to look at mysql. So, now I’m not sure if there actually is an issue, since things are working as advertised.

    Thanks for your continued support and for clarifying the account used for mysql - I really do love this product!

    Cheers,
    Dave.



  • @Tom-Elliott said in MySQL errors in apache error log file with 1.2.0:

    @Dave-Wolf Storage Node Management User and Password are for FTP, not for MySQL.

    I see that now, I just opened up the Config.class.php file and saw that it uses my root account and password.

    I also checked the mysqld.sock file in the /var/run/mysqld directory and it’s there, with a 0 byte size and a modification date of this morning when I rebooted the server. The PID of the mysql process is in the mysqld.pid file in that same directory and the mysql process is running with that PID.

    I am able to login to mysql with my root account and password. Is there a command I can run, other than ‘status’ to see if things are operational?

    Thanks,
    Dave.


  • Senior Developer

    @Dave-Wolf Storage Node Management User and Password are for FTP, not for MySQL.



  • @Tom-Elliott said in MySQL errors in apache error log file with 1.2.0:

    What did you do to try to “fix” unrelated issues? If you were playing with mysql configuration settings, did you change where the .sock file is located? Maybe you updated the OS and that changed where the .sock file is generated?

    We need the details to help you more accurately. Why I ask about the sock files is due to the first error you see (Can’t connect to local MySQL server through socket…)

    Hi Tom,

    I didn’t actually change any MyQSL settings, I thought my original problem was related to MySQL, so I was stepping through the MySQL troubleshooting steps trying to login with the fogstorage account. I couldn’t for some reason (access denied) so I changed the password, updated it in the Storage Nodes section, and began noticing the errors in the log. I thought the socket error was possibly due to failing credentials. I didn’t reinstall or update the OS during my troubleshooting, I just changed the fogstorage password. I have since changed it back to the original password, which was ‘fs9408241485’ and updated it in the Storage Nodes section of the configuration. Is this a hashed password? Is the hashed password stored in the configuration page? So maybe I need to hash it and change it in the mysql command prompt?

    Thanks for the help!

    Cheers,
    Dave.


  • Senior Developer

    What did you do to try to “fix” unrelated issues? If you were playing with mysql configuration settings, did you change where the .sock file is located? Maybe you updated the OS and that changed where the .sock file is generated?

    We need the details to help you more accurately. Why I ask about the sock files is due to the first error you see (Can’t connect to local MySQL server through socket…)


Log in to reply
 

401
Online

39210
Users

10856
Topics

103346
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.