[dev.icinga.com #3399] FROM_UNIXTIME(NULL) does not work with MySQL 5.0.x #1146
Comments
Updated by mfriedrich on 2012-10-25 11:54:19 +00:00
|
Updated by gingernator007 on 2012-10-25 12:22:24 +00:00 Thanks for the response, I've had to roll back the update due to this being our Production system, any ideas why this happened and how I can prevent it for the next attempt? Looking back at the syslog, we have many other errors along the same lines...
|
Updated by mfriedrich on 2012-10-25 12:34:20 +00:00 without the backend schema it will be hard to determine how it had been looking when the error occured. got a test vm, where you can put the prod clone, and re-create the error? |
Updated by newmanium on 2012-11-01 19:40:42 +00:00 I think I just encountered this same bug on my fresh 1.8 Icinga install. It looks timestamp fields are created NOT NULL by default in MySQL (at least 5.0+ from what I can tell). However, the CREATE statements in the schema sql script look like this:
Note that "NULL" is not specified in any of the timestamp columns, and they would therefore default to "NOT NULL" as per the MySQL documentation: When I started up icinga with the idoutils module, I started getting a spamming of errors like this in my /var/log/messages:
So, this bugfix may be as simple as adding the word "NULL" to all the schema creation and update statements for timestamp columns. I set all my timestamp columns that were erroring in /var/log/messages to allow null values and things seem to be working fine meow. |
Updated by iso on 2012-11-08 15:58:37 +00:00 Same for me today at a 1.7.2 upgrade to 1.8.1. Ugrading the mysql schema by
gave errors, continued with
which run without a comment. I now have a lot of |
Updated by mfriedrich on 2012-11-08 16:25:56 +00:00 iso wrote:
that script is not necessary to be run. you should have run that already when installing/upgrading to 1.7.x
which errors exactly?
|
Updated by iso on 2012-11-09 08:50:15 +00:00 Cannot remember the errors and the output is gone. I was a bit confused because I knew that I had to update the db scheme incrementally. Upgrading from 1.7.2 to 1.8.1 I was not sure about the 1.7.0 and 1.8.0 files. @ ---------------------------------------------------------------+ ------------- ------- mysql> |
Updated by mfriedrich on 2012-11-09 16:51:47 +00:00
so, the mysql version where this problem occurs, is only 5.0.x right? i cannot reproduce that on debian with 5.1.x |
Updated by iso on 2012-11-11 11:50:43 +00:00 Mine is: |
Updated by iso on 2012-11-14 14:12:45 +00:00 I can reproduce this on a fresh installation. Syslog started to fill up as I activated the idoutils module confiuration. Without it I had all functionality I need, but no ido2db error logging. I think that means I don't need idoutils and mysql? Weird... |
Updated by mfriedrich on 2012-11-14 14:57:59 +00:00 idomod/ido2db is a requirement when using the database backend, which is a requirement for -web or -reports e.g. deactivating the neb module (idomod) will break the communication of between core and ido2db, and therefore leaving ido2db idle doing nothing. seems i need to get a centos 5.x virtualbox image somewhere in order to reproduce that. |
Updated by iso on 2012-11-14 15:02:52 +00:00 I'm running this on two sles11. |
Updated by aledermueller on 2012-11-16 07:17:04 +00:00 I think it is not a bug in the query or db schema, but rather in mysql. The mysql docs say: "In addition, you can initialize or update any TIMESTAMP column to the current date and time by assigning it a NULL value, unless it has been defined with the NULL attribute to permit NULL values." [1] FROM_UNIXTIME(NULL) gives back the value NULL and last_log_rotation is defined with 'not null', hence it should get a current time stamp. We had the same problem on sles11 and with an update of mysql everything worked fine. [1] http://dev.mysql.com/doc/refman/5.0/en/timestamp-initialization.html |
Updated by gingernator007 on 2012-11-19 12:59:53 +00:00 Just to update this, we're running mysql 5.0.77. |
Updated by mfriedrich on 2012-11-25 23:29:39 +00:00
|
Updated by mfriedrich on 2012-11-25 23:44:33 +00:00 el5 is likely to die with the 5.0.x tree and will never provide any upgraded packages. though, i did not see such errors with my rhel 5.8 mysql 5.0.77 in the past. any chance that you check if there's a newer package revision available, maybe fixing the mentioned bug? https://www.centos.org/modules/newbb/viewtopic.php?topic\_id=22682 other than that, from what i've seen in the community, mysql 5.5 scales even better than 5.1 (ofc with some dba love too). |
Updated by mfriedrich on 2012-11-28 14:52:08 +00:00
hm. Carl found an interesting one, which can be taken as reference to this issue - see #3466 So relating to that one, it's not a matter of upgrade cycles from 1.5.2 to 1.8.x, but only the FROM_UNIXTIME(NULL) change introduced in 1.8.0/1.8.1 which can be fixed by explicitely setting the null'ed timestamp then. I expect #3466 resolving this issue as well, as it's merely a duplicate then. |
Updated by mfriedrich on 2012-11-28 15:11:06 +00:00
|
Updated by mfriedrich on 2014-12-08 14:37:55 +00:00
|
This issue has been migrated from Redmine: https://dev.icinga.com/issues/3399
Created by gingernator007 on 2012-10-25 10:07:55 +00:00
Assignee: crfriend
Status: Resolved (closed on 2012-11-28 15:11:06 +00:00)
Target Version: 1.8.2
Last Update: 2014-12-08 14:37:55 +00:00 (in Redmine)
After upgrading Icinga from 1.5.2 -> 1.8.0, IDOUTILS began outputting errors when trying to update the mysql db. I updated the schema incrementally as the instructions specified and shut down the Icinga service before doing so. Due to this Icinga Web can't pull the status of any of my hosts or services. Have I upgraded this incorrectly?
ido2db: Error: database query failed for 'INSERT INTO icinga_programstatus (instance_id, status_update_time, program_start_time, is_currently_running, process_id, daemon_mode, last_command_check, last_log_rotation, notifications_enabled, active_service_checks_enabled, passive_service_checks_enabled, active_host_checks_enabled, passive_host_checks_enabled, event_handlers_enabled, flap_detection_enabled, failure_prediction_enabled, process_performance_data, obsess_over_hosts, obsess_over_services, modified_host_attributes, modified_service_attributes, global_host_event_handler, global_service_event_handler, disable_notif_expire_time) VALUES (1, FROM_UNIXTIME(1350996440), FROM_UNIXTIME(1350995903), '1', 26056, 1, FROM_UNIXTIME(1350996439), FROM_UNIXTIME(NULL), 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, '', '', FROM_UNIXTIME(NULL))' - '1048: Column 'last_log_rotation' cannot be null'
Changesets
2012-11-28 14:53:21 +00:00 by mfriedrich 1042107
The text was updated successfully, but these errors were encountered: