Ad Widget

Collapse

New Maps Won't Save

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdunn
    Junior Member
    • Apr 2016
    • 2

    #1

    New Maps Won't Save

    Hi,

    I can't figure this one out, mainly because I am not great with MySQL. If we create a new map, add an element and then click Update, the following message appears:

    Map update failed.
    error: Error in query [INSERT INTO sysmaps_elements (selementid,elementtype,elementid,iconid_off,label ,label_location,x,y,use_iconmap,application,sysmap id) VALUES ('163','4','0','1','New element','-1','551','251','1','','12')] [Cannot add or update a child row: a foreign key constraint fails (`zabbix`.`sysmaps_elements`, CONSTRAINT `c_sysmaps_elements_2` FOREIGN KEY (`iconid_off`) REFERENCES `images` (`imageid`))]
    error: SQL statement execution has failed "INSERT INTO sysmaps_elements (selementid,elementtype,elementid,iconid_off,label ,label_location,x,y,use_iconmap,application,sysmap id) VALUES ('163','4','0','1','New element','-1','551','251','1','','12')".

    The behaviour also happens when I try to make a new element on an existing Map. If I delete an element from an existing Map and click Update, everything works fine.

    Any help is greatly appreciated.
  • mdunn
    Junior Member
    • Apr 2016
    • 2

    #2
    I was able to fix this, here is what it was in case anyone stumbles across this thread.

    I looked at SHOW ENGINE INNODB STATUS which reported a bunch of stuff including:
    But the parent table `zabbix`.`images`
    or its .ibd file does not currently exist!

    When I looked at the create table info for images it was set to MyISAM. All of the other tables were InnoDB so I figured I might as well change the images table to InnoDB with:
    ALTER TABLE images ENGINE=InnoDB

    Now my maps are saving.

    Comment

    Working...