PDA

View Full Version : Alpha 11 sql error


dmz
14-06-2005, 07:59
In "include/functions.c" line 1508 the following line has an error:

snprintf(sql,sizeof(sql)-1,"insert into escalation_log (triggerid,alarmid,escalationid,level,adminlevel,n extcheck,nextcheck) values (%d,%d,%d,%d,%d,%d,%d)", trigger->triggerid, alarmid, escalationid, 0, 0, 0, 0);

It has nextcheck,nextcheck. Below is what it should be (I assume)

snprintf(sql,sizeof(sql)-1,"insert into escalation_log (triggerid,alarmid,escalationid,level,adminlevel,n extcheck) values (%d,%d,%d,%d,%d,%d)", trigger->triggerid, alarmid, escalationid, 0, 0, 0);


Also, I don't believe the mysql upgrade patch includes the creation of the escalation_log. I haven't checked previous versions to see if it was there, but since I went from alpha10 to alpha11 off cvs and it wasn't there...

welshpjw
14-06-2005, 19:06
Don't mean to sound bad, but are you sure you are talking about Zabbix 1.1 alpha 11 and not 1.0 alpha 11? Or did you mean 1.1 alpha 10? I do not find (yet) the alpha 11 anywhere for 1.1 . I only find alpha 11 for 1.0... :confused:

skendall
09-08-2005, 22:21
No he is correct. I ran into the same problem upgrading from 1.1Alpha10 to 1.1Alpha11. The DB upgrade script does not create the needed escalation_log table and it does not exist in the 1.1Alpha10 schema.

I used the table add data from the create/myaql/schema.sql script that you would need to import on a new install.

mysql> CREATE TABLE escalation_log (
-> escalationlogid int(4) NOT NULL auto_increment,
-> triggerid int(4) DEFAULT '0' NOT NULL,
-> alarmid int(4) DEFAULT '0' NOT NULL,
-> escalationid int(4) DEFAULT '0' NOT NULL,
-> actiontype int(4) DEFAULT '0' NOT NULL,
-> level int(4) DEFAULT '0' NOT NULL,
-> adminlevel int(4) DEFAULT '0' NOT NULL,
-> nextcheck int(4) DEFAULT '0' NOT NULL,
-> status int(4) DEFAULT '0' NOT NULL,
-> PRIMARY KEY (escalationlogid),
-> KEY (alarmid,escalationid),
-> KEY (triggerid)
-> ) type=InnoDB;
Query OK, 0 rows affected (0.15 sec)

mysql>

Without adding this table from an upgrade from 1.1Alpha10 to 1.1Alpha11 the server process won't start and dies with this error.

007017:20050809:150344 Query::select escalationlogid,triggerid, alarmid, escalationid, level, adminlevel, nextcheck,
status from escalation_log where status=0 and nextcheck<=1123617824
007017:20050809:150344 Query failed:Table 'zabbix.escalation_log' doesn't exist [1146]
007018:20050809:150344 server #5 started [Poller. SNMP:ON]
007013:20050809:150344 One child process died. Exiting .