Database errors during installation



  • Hello. I am doing a clean install of Fog 1.2.0 on RHEL 7. I have disabled both the firewall and SE Linux (though of course i’ll be doing some investigation after Fog is running to see what is necessary to re-enable those!).

    The installer directed me to visit [url]http://10.10.1.48/fog/management[/url] to install the schema. So i did that. But the installer gives lots of errors, which i have pasted below.

    I can see in MySQL that the database and tables get created. But the tables are empty. For example, if I do “select * from users;” I get an empty set.

    I might be able to hack the file that gets imported into MySQL to fix it, but where is that file in the source? I searched for files with both .sql and .mysql extensions but didn’t find much. Or is there something else I should be doing to get this installed?

    Thanks in advance for any advice!

    Error output:

    Database Schema Installer / Updater
    Update/Install Failed!
    The following errors occured
    Update ID: 1 - 10
    Database Error:
    Incorrect integer value: ‘’ for column ‘uId’ at row 1
    Database SQL:
    INSERT INTO fog.users VALUES (’’,‘fog’, MD5(‘password’),‘0000-00-00 00:00:00’,’’)
    Update ID: 1 - 11
    Database Error:
    Incorrect integer value: ‘’ for column ‘osID’ at row 1
    Database SQL:
    INSERT INTO fog.supportedOS VALUES (’’,‘Windows XP’, ‘1’)
    Update ID: 1 - 12
    Database Error:
    Incorrect integer value: ‘’ for column ‘vID’ at row 1
    Database SQL:
    INSERT INTO fog.schemaVersion VALUES (’’,‘1’)
    Update ID: 2 - 0
    Database Error:
    Incorrect integer value: ‘’ for column ‘osID’ at row 1
    Database SQL:
    INSERT INTO fog.supportedOS VALUES (’’,‘Windows Vista’, ‘2’)
    Update ID: 5 - 2
    Database Error:
    Incorrect integer value: ‘’ for column ‘osID’ at row 1
    Database SQL:
    INSERT INTO fog.supportedOS VALUES (’’,‘Other’, ‘99’)
    Update ID: 16 - 9
    Database Error:
    Field ‘ngmKey’ doesn’t have a default value
    Database SQL:
    INSERT INTO
    fog.nfsGroupMembers
    (ngmMemberName, ngmMemberDescription, ngmIsMasterNode, ngmGroupID, ngmRootPath, ngmIsEnabled, ngmHostname, ngmMaxClients, ngmUser, ngmPass)
    VALUES
    (‘DefaultMember’, ‘Auto generated fog nfs group member’, ‘1’, ‘1’, ‘/images/’, ‘1’, ‘10.10.1.48’, ‘10’, ‘fog’, ‘5836d2’)


  • Senior Developer

    sql_mode=STRICT_ALL_TABLES is not default for either mysql or mariadb to my knowledge.


  • Moderator

    [quote=“dramaley, post: 45894, member: 29347”]I found the problem. Our default MySQL/MariaDB configuration includes the line “sql_mode=STRICT_ALL_TABLES”. Fog doesn’t work with that enabled. If I remove that line from our configuration it works just fine!

    I did my testing with the version of Fog that is in git. It installs and runs cleanly with no errors, as long as STRICT_ALL_TABLES is off.

    So, one related question: Should I submit a bug report to update Fog so that it will work with strict mode, or should i just ignore the issue?[/quote]

    A better question might be… Is sql_mode=STRICT_All_TABLES default?



  • I found the problem. Our default MySQL/MariaDB configuration includes the line “sql_mode=STRICT_ALL_TABLES”. Fog doesn’t work with that enabled. If I remove that line from our configuration it works just fine!

    I did my testing with the version of Fog that is in git. It installs and runs cleanly with no errors, as long as STRICT_ALL_TABLES is off.

    So, one related question: Should I submit a bug report to update Fog so that it will work with strict mode, or should i just ignore the issue?


  • Moderator

    Just kicking around ideas but you say you have a “Base Image of RHEL 7”… Could you make a fresh one and try?

    Also, is it absolutely necessary to use mariaDB? Why not install MySQL instead? [url]http://www.cyberciti.biz/faq/how-to-install-mysql-under-rhel/[/url]



  • Oh, I’ll definitely post back what it took to make it work, if I am able to. :)

    I don’t have any base images set up for anything other than RHEL. If anyone has a different Linux already set up with Fog already running on it, could you please do a mysqldump of the database right after a clean install? And also tell me which version you installed–whether 1.2.0 or something newer from the source repositories. I’m just wondering if I can get a good database created if Fog will start working; the rest of the installer seems to run just fine.


  • Moderator

    Welcome.

    If you get it going, please do share what you’ve done.



  • OK, thanks for the feedback. We can’t use Fedora since it is not supported in our virtual environment (Citrix XenServer). RHEL is what we’ve standardized on and is the only Linux we really have internal support for, though we do have a few rogue Debian, Ubuntu, and even CentOS machines that we’ve inherited from other departments and haven’t had time to properly assimilate yet. I’m surprised CentOS is really that different though; I (mistakenly?) thought RHEL and CentOS were almost the same thing. If I have time in the near future I’ll try setting up a CentOS 7 machine and getting Fog running on it, and see if i can then migrate the installation to RHEL. Thanks for your time!


  • Moderator

    If this box is only going to be running FOG, I would really recommend Fedora 21 server; or Ubuntu Server, Debian, or CentOS.

    I’m not saying REHL is bad at all. I am not saying that. I’m just saying that there is extensive documentation for Ubuntu, Fedora, Debian, and CentOS; both in the WiKi and in the Forums.

    And, if you had one of these four, you’d have a huge support base…

    But, if you choose to continue with FOG on REHL, you’ll probably be the one writing the documentation for it…



  • RHEL7 is our standard distro for new services. We’re in the middle of migrating from RHEL6, and new services are only stood up on 7. Being “cool” is not really a concern; RHEL7 has been out for almost a year and (like most RHEL releases) is based on somewhat outdated software, so it isn’t exactly new. If we wanted new and shiny we’d probably be running Fedora or Debian Testing. :)


  • Moderator

    Is there a particular reason why you’ve chosen RHEL 7? Or are you just wanting to be the cool guy?



  • Well, yes they impact the operation of Fog. It just doesn’t work because it is not installed properly. When I go to /fog/management I always just get the “Database Schema Installer / Updater” screen because the database tables were not populated correctly.


  • Senior Developer

    Are these errors impacting the operation of FOG?



  • Hello again! Thanks for the idea to get the latest source. I followed the Uninstall_FOG article in the Wiki to completely remove Fog, then downloaded the latest version using git. (Is there a difference between git and svn? I’m more familiar with git so used it, but if the code is different I’ll be happy to repeat with subversion source.) I ran the installer and visited the [url]http://10.10.1.48/fog/management[/url] URL in my browser when it asked me to. But I still get a lot of errors:

    Install / Update Failed!
    The following errors occured

    Update ID: 1 - 10
    Database Error:
    Incorrect integer value: ‘’ for column ‘uId’ at row 1
    Database SQL:
    INSERT INTO fog.users VALUES (’’,‘fog’, MD5(‘password’),‘0000-00-00 00:00:00’,’’)

    Update ID: 1 - 11
    Database Error:
    Incorrect integer value: ‘’ for column ‘osID’ at row 1
    Database SQL:
    INSERT INTO fog.supportedOS VALUES (’’,‘Windows XP’, ‘1’)

    Update ID: 1 - 12
    Database Error:
    Incorrect integer value: ‘’ for column ‘vID’ at row 1
    Database SQL:
    INSERT INTO fog.schemaVersion VALUES (’’,‘1’)

    Update ID: 2 - 0
    Database Error:
    Incorrect integer value: ‘’ for column ‘osID’ at row 1
    Database SQL:
    INSERT INTO fog.supportedOS VALUES (’’,‘Windows Vista’, ‘2’)

    Update ID: 5 - 2
    Database Error:
    Incorrect integer value: ‘’ for column ‘osID’ at row 1
    Database SQL:
    INSERT INTO fog.supportedOS VALUES (’’,‘Other’, ‘99’)

    Update ID: 16 - 9
    Database Error:
    Field ‘ngmKey’ doesn’t have a default value
    Database SQL:
    INSERT INTO fog.nfsGroupMembers (ngmMemberName, ngmMemberDescription, ngmIsMasterNode, ngmGroupID, ngmRootPath, ngmIsEnabled, ngmHostname, ngmMaxClients, ngmUser, ngmPass) VALUES (‘DefaultMember’, ‘Auto generated fog nfs group member’, ‘1’, ‘1’, ‘/images/’, ‘1’, ‘10.10.1.48’, ‘10’, ‘fog’, ‘458fe0’)

    Update ID: 122 - 1
    Database Error:
    Field ‘pxeParams’ doesn’t have a default value
    Database SQL:
    INSERT INTO fog.pxeMenu (pxeID,pxeName,pxeDesc,pxeDefault,pxeRegOnly,pxeArgs) VALUES (1, ‘fog.local’, ‘Boot from hard disk’, ‘1’,‘2’,NULL), (2, ‘fog.memtest’, ‘Run Memtest86+’, ‘0’,‘2’,NULL), (3, ‘fog.reginput’, ‘Perform Full Host Registration and Inventory’,‘0’,‘0’,‘mode=manreg’), (4, ‘fog.keyreg’, ‘Update Product Key’, ‘0’,‘1’,NULL), (5, ‘fog.reg’, ‘Quick Registration and Inventory’, ‘0’,‘0’,‘mode=autoreg’), (6, ‘fog.quickimage’, ‘Quick Image’, ‘0’, ‘1’,NULL), (7, ‘fog.multijoin’, ‘Join Multicast Session’, ‘0’,‘1’,NULL), (8, ‘fog.quickdel’, ‘Quick Host Deletion’,‘0’,‘1’,NULL), (9, ‘fog.sysinfo’, ‘Client System Information (Compatibility)’,‘0’,‘2’,‘mode=sysinfo’), (10, ‘fog.debug’, ‘Debug Mode’,‘0’,‘3’,‘mode=onlydebug’), (11, ‘fog.advanced’, ‘Advanced Menu’,‘0’,‘4’,NULL), (12, ‘fog.advancedlogin’, ‘Advanced Menu’,‘0’,‘5’,NULL);

    Update ID: 129 - 0
    Database Error:
    Field ‘pxeParams’ doesn’t have a default value
    Database SQL:
    INSERT INTO fog.pxeMenu (pxeID,pxeName,pxeDesc,pxeDefault,pxeRegOnly,pxeArgs) VALUES (13, ‘fog.approvehost’, ‘Approve This Host’,‘0’,‘6’,NULL);

    Update ID: 130 - 4
    Database Error:
    Field ‘hmDesc’ doesn’t have a default value
    Database SQL:
    INSERT INTO fog.hostMAC (hmHostID,hmMAC,hmIgnoreClient,hmIgnoreImaging,hmPending,hmPrimary) SELECT hostID,hostMAC,‘0’,‘0’,‘0’,‘1’ FROM fog.hosts WHERE hosts.hostMAC IS NOT NULL

    Update ID: 130 - 5
    Database Error:
    Field ‘hmDesc’ doesn’t have a default value
    Database SQL:
    INSERT INTO fog.hostMAC (hmMAC,hmHostID,hmPending) SELECT pmAddress,pmHostID,‘1’ FROM fog.pendingMACS WHERE pmAddress IS NOT NULL

    Update ID: 162 - 0
    Database Error:
    Can’t DROP ‘stID’; check that column/key exists
    Database SQL:
    ALTER TABLE fog.snapinTasks DROP INDEX stID

    Update ID: 162 - 1
    Database Error:
    Can’t DROP ‘stID_2’; check that column/key exists
    Database SQL:
    ALTER TABLE fog.snapinTasks DROP INDEX stID_2

    Update ID: 162 - 2
    Database Error:
    Can’t DROP ‘stJobID’; check that column/key exists
    Database SQL:
    ALTER TABLE fog.snapinTasks DROP INDEX stJobID

    Update ID: 162 - 3
    Database Error:
    Can’t DROP ‘stJobID_2’; check that column/key exists
    Database SQL:
    ALTER TABLE fog.snapinTasks DROP INDEX stJobID_2

    Update ID: 162 - 4
    Database Error:
    Can’t DROP ‘stJobID_3’; check that column/key exists
    Database SQL:
    ALTER TABLE fog.snapinTasks DROP INDEX stJobID_3

    [url="/_imported_xf_attachments/1/1865_error_log-20150413.txt?:"]error_log-20150413.txt[/url][url="/_imported_xf_attachments/1/1866_foginstall.log-20150413.txt?:"]foginstall.log-20150413.txt[/url]


  • Senior Developer

    dramaley, as you’re running a version of Redhat/Centos/Fedora that was released AFTER 1.2.0 was released, I’d recommend you try SVN for the installation.



  • Has anyone successfully installed Fog on RHEL 7? Here’s exactly what I did to install it:

    tar -xvzf fog_1.2.0.tar.gz -C /opt

    vim /opt/fog_1.2.0/lib/redhat/functions.sh

    I commented out the “exit 1;” line in the configureMySQL function; I found this in the wiki as something necessary to make it work with MariaDB. Should I have skipped that?

    cd /opt/fog_1.2.0/bin

    ./installfog.sh

    Was there anything else that I missed?


  • Moderator

    [quote=“HEL, post: 45327, member: 1329”]
    this has fixed my problem on Debian 6.0.3, Debian 7.7, Debian 7.8.
    HEL[/quote]

    This person is a member since June 2012… Pops out of nowhere with a solution… On their first post… lol gotta love it.



  • [quote=“dramaley, post: 45325, member: 29347”]Thank you for the responses so far!

    I was able to find where the database is created and might look into hacking it into working. But for now I’ll wait before taking any action, in case someone can help me understand the root cause and fix it more elegantly.

    I’ll also attach the foginstall.log and Apache error_log to this post in case that is useful; I did notice some errors in the error_log that I don’t understand yet.

    I checked in /var/www/html/fog/lib/fog/Config.class.php and found the root database password was correct. It does use some funny characters, but there are no single quotes in the password so it should be just fine. I can confirm that the database was actually created, with tables:

    [root@fog-test fog]# mysql
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 28
    Server version: 5.5.41-MariaDB MariaDB Server

    Copyright © 2000, 2014, Oracle, MariaDB Corporation Ab and others.

    Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

    MariaDB [(none)]> use fog;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    MariaDB [fog]> show tables;
    ±-----------------------+
    | Tables_in_fog |
    ±-----------------------+
    | aloLog |
    | clientUpdates |
    | dirCleaner |
    | globalSettings |
    | greenFog |
    | groupMembers |
    | groups |
    | history |
    | hostAutoLogOut |
    | hostMAC |
    | hostScreenSettings |
    | hosts |
    | imageTypes |
    | images |
    | imagingLog |
    | inventory |
    | keySequence |
    | moduleStatusByHost |
    | modules |
    | multicastSessions |
    | multicastSessionsAssoc |
    | nfsFailures |
    | nfsGroupMembers |
    | nfsGroups |
    | os |
    | oui |
    | pendingMACS |
    | plugins |
    | printerAssoc |
    | printers |
    | scheduledTasks |
    | schemaVersion |
    | snapinAssoc |
    | snapinJobs |
    | snapinTasks |
    | snapins |
    | supportedOS |
    | taskLog |
    | taskStates |
    | taskTypes |
    | tasks |
    | userCleanup |
    | userTracking |
    | users |
    | virus |
    ±-----------------------+
    45 rows in set (0.00 sec)

    MariaDB [fog]> select * from users;
    Empty set (0.00 sec)

    MariaDB [fog]>[/quote]

    Hi Dramaley,
    following this installation error, my database “fog” was not created, I looked in the file (Debian) /var/www/fog/lib/fog/Config.class.php and found that the user root password empty, during the installation of Fog I left it blank, in fact my mysql root user’s password was not empty.

    this has fixed my problem on Debian 6.0.3, Debian 7.7, Debian 7.8.

    I stay interested to know the solution in your case

    Thanks to all.

    HEL



  • Thank you for the responses so far!

    I was able to find where the database is created and might look into hacking it into working. But for now I’ll wait before taking any action, in case someone can help me understand the root cause and fix it more elegantly.

    I’ll also attach the foginstall.log and Apache error_log to this post in case that is useful; I did notice some errors in the error_log that I don’t understand yet.

    I checked in /var/www/html/fog/lib/fog/Config.class.php and found the root database password was correct. It does use some funny characters, but there are no single quotes in the password so it should be just fine. I can confirm that the database was actually created, with tables:

    [root@fog-test fog]# mysql
    Welcome to the MariaDB monitor. Commands end with ; or \g.
    Your MariaDB connection id is 28
    Server version: 5.5.41-MariaDB MariaDB Server

    Copyright © 2000, 2014, Oracle, MariaDB Corporation Ab and others.

    Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

    MariaDB [(none)]> use fog;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Database changed
    MariaDB [fog]> show tables;
    ±-----------------------+
    | Tables_in_fog |
    ±-----------------------+
    | aloLog |
    | clientUpdates |
    | dirCleaner |
    | globalSettings |
    | greenFog |
    | groupMembers |
    | groups |
    | history |
    | hostAutoLogOut |
    | hostMAC |
    | hostScreenSettings |
    | hosts |
    | imageTypes |
    | images |
    | imagingLog |
    | inventory |
    | keySequence |
    | moduleStatusByHost |
    | modules |
    | multicastSessions |
    | multicastSessionsAssoc |
    | nfsFailures |
    | nfsGroupMembers |
    | nfsGroups |
    | os |
    | oui |
    | pendingMACS |
    | plugins |
    | printerAssoc |
    | printers |
    | scheduledTasks |
    | schemaVersion |
    | snapinAssoc |
    | snapinJobs |
    | snapinTasks |
    | snapins |
    | supportedOS |
    | taskLog |
    | taskStates |
    | taskTypes |
    | tasks |
    | userCleanup |
    | userTracking |
    | users |
    | virus |
    ±-----------------------+
    45 rows in set (0.00 sec)

    MariaDB [fog]> select * from users;
    Empty set (0.00 sec)

    MariaDB [fog]>

    [url="/_imported_xf_attachments/1/1862_foginstall.log.txt?:"]foginstall.log.txt[/url][url="/_imported_xf_attachments/1/1863_error_log.txt?:"]error_log.txt[/url]


  • Senior Developer

    The sql file you’re referring to is located in the web directory. It’s specifically located in Redhat at location /var/www/html/fog/commons/schema.php

    I don’t know if this will help you out at all, but it’s where all of the schema is setup. However, are you using a password for MySQL/MariaDB? I ask because I’ve heard of a few cases where the DB isn’t really setup properly. This is in particular to the password in use. I don’t know what the password is, but it’s just a theory that it may be using special characters that aren’t translating properly into the /var/www/html/fog/lib/fog/Config.class.php file. You’re sure the fog.users table actually exists, and it’s not just printing the errors because it simply can’t connect?


Log in to reply
 

380
Online

38980
Users

10712
Topics

101676
Posts

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