Your FOG database schema is not up to date...

  • Hi all,

    Had it before, and I know there’s a few causes of this, but is there a definitive writeup on the causes for this?

    • New 14.04.2 server
    • Installed FOG
    • Imported over an existing database
    • Everything seemed to work fine
    • Altered /opt/fog/.fogsettings to remove the password from the password field, but I kept the snmysqlpass, since my sql database has a password

    On system startup, everything works fine… for a while. Then eventually, that database schema message comes up. Can’t say how or why, either.

    Here is what happens on a system reboot:

    [CODE]local_admin@fog:~$ ps aux | grep mysql
    mysql 1089 2.3 1.2 821128 49136 ? Ssl 16:11 0:00 /usr/sbin/mysqld
    root 1486 0.0 0.0 4440 700 ? S 16:11 0:00 /bin/sh /usr/bin/mysqld_safe
    mysql 1838 0.1 0.8 380768 33084 ? Sl 16:11 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/ --socket=/var/run/mysqld/mysqld.sock --port=3306

    Eventually, you get the schema message. I can either kill process 1089 (which kills all three sql processes and restarts a new one) or I can wait even longer and just 1486 and 1838 die anyway, leaving 1089 (which I have to also restart). Either way, on a restart it looks like this:

    [CODE]local_admin@fog:~$ ps aux | grep mysql
    mysql 2627 7.0 1.0 418540 41640 ? Ssl 16:16 0:00 /usr/sbin/mysqld
    So all the SQL services died, but then just one will end up running and Fog web management works fine again.
    I had this before and totally forgot what I actually did to fix it!

  • the snmysqluser and snmysqlpass should have content, but it is not required. If you have a mysql password set, at the least you would need the snmysqlpass to assist when upgrading from a previous install. It not existing under normal circumstances shouldn’t affect the running of fog.

  • So I just tried something else instead;

    • Fresh FOG install
    • Gave the database a password again
    • Same error

    Looking at /opt/fog/.fogsettings, there is no username or hostname there under snmysqluser or snmysqlhost; how come? Could this be the cause at all?

    After filling both in, I ran dpkg-reconfigure mysql-server-5.5 as suggested somewhere else and that has fixed it. There is just one mysql service running now.

    Also - that is some broken formatting below 😄

  • need2 - yes, and you get the usual error relating to the DB already existing. Unless you mean to reinstall FOG…

    Tom - somewhere you suggested at this - so now actually, all I’ve had to do is the line where it says:

    echo manual | sudo tee /etc/init/mysql.override

    The output suggests that mysql isn’t running at all now - just mysql_d/safe.

    root      1459  0.0  0.0  4440  700 ?        S    16:55  0:00 /bin/sh /usr/bin/mysqld_safe
    mysql    1811  1.6  1.3 615736 53348 ?        Sl  16:55  0:03 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/var/run/mysqld/ --socket=/var/run/mysqld/mysqld.sock --port=3306

    So far, it works fine. Hopefully one day a definitive cause to everything will be found and things will make sense 🙂

    Cheers again!

  • Moderator

    Have you tried rerunning the installer?

  • Yeah I just used the PIDs as thats what I have at the moment, I know itll change, but you get the idea 😄

    I’ll keep digging then and update this if I find anything else!


  • You may want to generalize the pids a bit more. PIDS aren’t the same on every machine. Even in your “restart” of the mysqld process the PID (Process ID) changed from 1838 to 2627.

    This is known about but no there is no definitive write up as we don’t know what is causing it. I have yet to actually see the problem on my ubuntu or centos machines. Part of that may be I have a separated mysql server that both connect to, but I also did not see these issues when I had the mysql db’s locally hosted.