I am trying to install NConf. NConf and Nagios is on Linux, the MySql server is on windows.
I am getting an error when creating the tables (using manual install)
Command I run connecting to the MySql server from a Linux terminal
mysql -h mysqlserver -u nconf -p nconf < INSTALL/create_database.sql
Error:
ERROR 1265 (01000) at line 44: Data truncated for column 'link_as_child' at row 1
MySql version is 5.0.51b InnoDB is installed and running.
NConf version 1.2.5
Nagios version 3.1.2
What to do now?
Error on install of MySql tables
Re: Error on install of MySql tables
This is an issue with the table configattrs. The link_as_child is an enum type. All the other enum types have at least two valid values. This one has one - "yes" - with a default of NULL. The INSERT sql line has '' instead of the word NULL.
Not sure which is wrong - the data type for the field or if the INSERT data for this field should be NULL instead of ''?
Not sure which is wrong - the data type for the field or if the INSERT data for this field should be NULL instead of ''?
- agargiulo
- NConf developer
- Posts:725
- Joined:Fri Mar 06, 2009 17:50
- Location:Zurich, Switzerland
- Contact:
Re: Error on install of MySql tables
Hi.
I don't think the ENUM is a problem. It can be left empty, since it is not explicitly defined as "NOT NULL". Unless maybe your MySQL version handles it differently and then I'm wrong.
I suspect it's more likely there is a problem with some of the data being inserted into the table. Can you do a few tests? Maybe create the table and do some manual inserts? It's the first time someone reports a problem with the install script.
Thanks.
I don't think the ENUM is a problem. It can be left empty, since it is not explicitly defined as "NOT NULL". Unless maybe your MySQL version handles it differently and then I'm wrong.
I suspect it's more likely there is a problem with some of the data being inserted into the table. Can you do a few tests? Maybe create the table and do some manual inserts? It's the first time someone reports a problem with the install script.
Thanks.
A.G. - NConf developer - http://www.nconf.org
If you like NConf,
rate it here: https://sourceforge.net/projects/nconf/reviews/
or here: http://exchange.nagios.org/directory/Ad ... nf/details
If you like NConf,
rate it here: https://sourceforge.net/projects/nconf/reviews/
or here: http://exchange.nagios.org/directory/Ad ... nf/details
Re: Error on install of MySql tables
Thanks for the reply.
I used phpMyAdmin to manually insert into the configattrs table. I left the link_as_child field blank and unchecked the null checkbox. phpMyAdmin formatted the field with a '' just like the script does.
I received the same error.
I changed the value in the INSERT statement to NULL and the record was accepted
I then edited the field link_as_child and changed the valid enum values to 'yes','' Did the same test, and the record was accepted. Apparently something has changed within MySql to only accept a valid enum value or NULL
I decided to change the valid enum values to 'yes','' in the install script for this field. The script then executed without error.
I used phpMyAdmin to manually insert into the configattrs table. I left the link_as_child field blank and unchecked the null checkbox. phpMyAdmin formatted the field with a '' just like the script does.
I received the same error.
I changed the value in the INSERT statement to NULL and the record was accepted
I then edited the field link_as_child and changed the valid enum values to 'yes','' Did the same test, and the record was accepted. Apparently something has changed within MySql to only accept a valid enum value or NULL
I decided to change the valid enum values to 'yes','' in the install script for this field. The script then executed without error.
- agargiulo
- NConf developer
- Posts:725
- Joined:Fri Mar 06, 2009 17:50
- Location:Zurich, Switzerland
- Contact:
Re: Error on install of MySql tables
Careful: setting the "link_as_child" attr to "yes" will have unexpected results. This could severely mess up your data in NConf! The attr should only be set to "yes" for the following attrs (NConf v1.2.5):
We will have to set this to "no" explicitly in the next release.
Thank you.
Code: Select all
+---------+--------------+---------------+---------------+
| id_attr | attr_name | config_class | link_as_child |
+---------+--------------+---------------+---------------+
| 59 | members | contactgroup | yes |
| 74 | command_name | host-template | yes |
| 29 | members | hostgroup | yes |
| 72 | members | servicegroup | yes |
+---------+--------------+---------------+---------------+
Thank you.
A.G. - NConf developer - http://www.nconf.org
If you like NConf,
rate it here: https://sourceforge.net/projects/nconf/reviews/
or here: http://exchange.nagios.org/directory/Ad ... nf/details
If you like NConf,
rate it here: https://sourceforge.net/projects/nconf/reviews/
or here: http://exchange.nagios.org/directory/Ad ... nf/details
Re: Error on install of MySql tables
I did not set them to "yes", I simply changed the valid enum values in the field definition to accept the '' (two quote marks) so that the script would execute.
- agargiulo
- NConf developer
- Posts:725
- Joined:Fri Mar 06, 2009 17:50
- Location:Zurich, Switzerland
- Contact:
Re: Error on install of MySql tables
This issue has been fixed and will be part of release 1.2.6. The ENUM was changed to ('yes','no') like all the other ENUM's.
A.G. - NConf developer - http://www.nconf.org
If you like NConf,
rate it here: https://sourceforge.net/projects/nconf/reviews/
or here: http://exchange.nagios.org/directory/Ad ... nf/details
If you like NConf,
rate it here: https://sourceforge.net/projects/nconf/reviews/
or here: http://exchange.nagios.org/directory/Ad ... nf/details