Fehler nach Upgrade auf 0.9.9.7
-
Nach dem ich ein Upgrade auf 0.9.9.7 durchgeführt habe, bekomme ich beim Anlegen von neuen Objekten (egal was) folge Fehlermeldung:
isys_exception_database : Query error: 'INSERT INTO isys_obj (isys_obj__title, isys_obj__isys_obj_type__id, isys_obj__status, isys_obj__created,isys_obj__created_by,isys_obj__updated,isys_obj__updated_by,isys_obj__hostname,isys_obj__scantime,isys_obj__imported) VALUES ('', '5', '1', NOW(),'<user>',NOW(),'<user>','',NULL,'1970-01-01 01:00:00');': Cannot add or update a child row: a foreign key constraint fails (
idoit_data/isys_obj
, CONSTRAINTisys_obj_ibfk_2
FOREIGN KEY (isys_obj__isys_cmdb_status__id
) REFERENCESisys_cmdb_status
(isys_cmdb_status__id
) ON DELETE SET NULL ON UPDATE CASCADE)Was kann ich tun?</user></user>
-
Führ mal folgendes Statement in der Mandanten Datenbank aus:
SELECT * FROM isys_cmdb_status;
und poste das Ergebnis hier.
-
+–--------------------+----------------------------------------+---------------------------------------+------------------------+--------------------------+----------------------------+-------------------------------+----------------------------+-------------------------+
| isys_cmdb_status__id | isys_cmdb_status__title | isys_cmdb_status__const | isys_cmdb_status__sort | isys_cmdb_status__status | isys_cmdb_status__property | isys_cmdb_status__description | isys_cmdb_status__editable | isys_cmdb_status__color |
+----------------------+----------------------------------------+---------------------------------------+------------------------+--------------------------+----------------------------+-------------------------------+----------------------------+-------------------------+
| 1 | LC__CMDB_STATUS__PLANNED | C__CMDB_STATUS__PLANNED | NULL | 2 | NULL | NULL | 1 | EFAA43 |
| 3 | LC__CMDB_STATUS__ORDERED | C__CMDB_STATUS__ORDERED | NULL | 2 | NULL | NULL | 1 | 838683 |
| 5 | LC__CMDB_STATUS__DELIVERED | C__CMDB_STATUS__DELIVERED | NULL | 2 | NULL | NULL | 1 | DDECD5 |
| 7 | LC__CMDB_STATUS__ASSEMBLED | C__CMDB_STATUS__ASSEMBLED | NULL | 2 | NULL | NULL | 1 | C6DFB9 |
| 9 | LC__CMDB_STATUS__TESTED | C__CMDB_STATUS__TESTED | NULL | 2 | NULL | NULL | 1 | 95C47C |
| 11 | LC__CMDB_STATUS__IN_OPERATION | C__CMDB_STATUS__IN_OPERATION | NULL | 2 | NULL | NULL | 1 | 33C20A |
| 13 | LC__CMDB_STATUS__DEFECT | C__CMDB_STATUS__DEFECT | NULL | 2 | NULL | NULL | 1 | BC0A19 |
| 15 | LC__CMDB_STATUS__UNDER_REPAIR | C__CMDB_STATUS__UNDER_REPAIR | NULL | 2 | NULL | NULL | 1 | F990BE |
| 17 | LC__CMDB_STATUS__DELIVERED_FROM_REPAIR | C__CMDB_STATUS__DELIVERED_FROM_REPAIR | NULL | 2 | NULL | NULL | 1 | F3EF15 |
| 19 | LC__CMDB_STATUS__INOPERATIVE | C__CMDB_STATUS__INOPERATIVE | NULL | 2 | NULL | NULL | 1 | FF0000 |
| 21 | LC__CMDB_STATUS__STORED | C__CMDB_STATUS__STORED | NULL | 2 | NULL | NULL | 1 | A2BCFA |
| 23 | LC__CMDB_STATUS__SCRAPPED | C__CMDB_STATUS__SCRAPPED | NULL | 2 | NULL | NULL | 1 | 082B9A |
| 25 | LC__CMDB_STATUS__IDOIT_STATUS | C__CMDB_STATUS__IDOIT_STATUS | NULL | 2 | NULL | NULL | 0 | AAAAAA |
| 27 | LC__CMDB_STATUS__IDOIT_STATUS_TEMPLATE | C__CMDB_STATUS__IDOIT_STATUS_TEMPLATE | NULL | 2 | NULL | NULL | 0 | CCCCCC |
+----------------------+----------------------------------------+---------------------------------------+------------------------+--------------------------+----------------------------+-------------------------------+----------------------------+-------------------------+ -
Ah ok da scheint was falsch zu sein. Führ mal folgendes Statement aus:
ALTER TABLE
isys_obj
CHANGEisys_obj__isys_cmdb_status__id
isys_obj__isys_cmdb_status__id
INT( 10 ) UNSIGNED NOT NULL DEFAULT '11'Danach sollte die Anlage von Objekten funktionieren.
-
mysql> ALTER TABLE
isys_obj
CHANGEisys_obj__isys_cmdb_status__id
isys_obj__isys_cmdb_status__id
INT( 10 ) UNSIGNED NOT NULL DEFAULT '11';
ERROR 1025 (HY000): Error on rename of './idoit_data/#sql-53e9_1c9bcf' to './idoit_data/isys_obj' (errno: 150) -
Hmmmm mach mal folgendes:
set foreign_key_checks=0;
UPDATE isys_obj SET isys_obj__isys_cmdb_status__id = 11;
ALTER TABLEisys_obj
CHANGEisys_obj__isys_cmdb_status__id
isys_obj__isys_cmdb_status__id
INT( 10 ) UNSIGNED NULL DEFAULT '11'; -
Vielen Dank, jetzt funktioniert es wieder.