Menu

MySQL Error: 1062 Duplicate entry for NetworkDevice class with id as key 'PRIMARY' after deletion by WebUI

2020-02-04
2020-02-04
  • Rémi COURCELLE

    Rémi COURCELLE - 2020-02-04

    Hi,

    I've deleted by the WebUI a Several Network Devices on class NetworkDevices and when i push again the new device with the same name by my API python script i've a MySQL Error 1062:

    Error: Failed to issue SQL query: query = INSERT INTO networkdevice (id,networkdevicetype_id,iosversion_id,ram) VALUES (21286, 108, 803, 'N/A'), mysql_errno = 1062, mysql_error = Duplicate entry '21286' for key 'PRIMARY'

    however there are no duplicates in MySQL/phpmyadmin:
    SELECT * FROM functionalci WHERE id = '21286'

    21286 XXXX-XXXX-XX_member_Switch 1 1 low NULL NetworkDevice NULL N/A

    there is just one entry like above.
    Thanks for your responses.

    Remi.

     
  • Pierre Goiffon

    Pierre Goiffon - 2020-02-04

    Hello,
    One object can be persisted in multiple classes... You do not give much details on how you did delete the object sin the first place ? But the error you're getting can be caused by records still presents in some of the class hierarchy tables.
    Combodo made this free extension that can detect such inconsistencies, try it out :
    https://store.itophub.io/en_US/products/combodo-db-tools

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.