Closed naccey closed 1 year ago
Hello , For This Dublicate Solition
mysql error DBD::mysql::db do failed: Duplicate entry '3071' for key 'accountinfo.PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Inventory/Update/AccountInfos.pm line 66.
DBD::mysql::db do failed: Duplicate entry 'SESSION-CLEAN' for key 'engine_mutex.PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Communication/Session.pm line 59.
This problem will solve AccountInfos.pm line 66 and Session.pm line 59 you need to have a check before if statement with a sql query, it's problem weld to insert a same record in to db , ocs devs must have forgotten to make this line
Sample php function for crush the issue
function checkIfExist($e){ $q="SELECT * FROM DBTABLENAME WHERE col=$e" if(!$q){ $q="INSERT into DBTABLENAME col values ($e)" } else{die;} }
Hi, i have the three errors tooo :(
Duplicates & Prolog Full :(
Hi @naccey and @jjmg84 ,
Can you run the following queries for all problematic tables and return the result to me :
DESCRIBE my_table;
SELECT TABLE STATUS FROM 'my_database' WHERE name LIKE 'my_table';
SELECT count(*) FROM my_table;
@naccey : the PR #405 should fix deadlock on software.pm
Best regards, Charlene
Hi, i atach one line of every error:
DBD::mysql::db do failed: Duplicate entry '50581' for key 'PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/System.pm line 246.
Line 246 makes a insert: 'INSERT INTO locks(HARDWARE_ID, ID, SINCE) VALUES(?,?,NOW())
DBD::mysql::db do failed: Duplicate entry '66109' for key 'PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Inventory/Update/AccountInfos.pm line 66.
line 66 makes a insert: 'INSERT INTO accountinfo(HARDWARE_ID) VALUES(?)'
DBD::mysql::db do failed: Duplicate entry 'SESSION-CLEAN' for key 'PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Communication/Session.pm line 59.
Line 59 makes a insert: INSERT INTO engine_mutex(NAME, PID, TAG) VALUES('SESSION',?,'CLEAN')
Here are the data @charleneauger
thanks!
Hi @naccey, @Asimatasert, @jjmg84,
After analysis, it turns out that the server executes INSERT queries without verifying the existence of the data. We have added this correction to our Roadmap.
Regards, Charlene
It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.
General informations
Operating system : Ubuntu 20.04.4 LTS
Server informations
Perl version : perl 5, version 30 Mysql / Mariadb / Percona version :
MySQL Community Server - GPL version 8.0.20
OCS Inventory informations
Ocs server version : 2.9.2
Problem's description
Describe your problem here Hello All, I have few problems below and attacheded screenshot How to solve theese problems? Thanks for yours support sincerly ;)
mysql error DBD::mysql::db do failed: Duplicate entry '3071' for key 'accountinfo.PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Inventory/Update/AccountInfos.pm line 66.
DBD::mysql::db do failed: The table 'prolog_conntrack' is full at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Communication/Session.pm line 46.
DBD::mysql::db do failed: Duplicate entry 'SESSION-CLEAN' for key 'engine_mutex.PRIMARY' at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Communication/Session.pm line 59.
DBD::mysql::st execute failed: Deadlock found when trying to get lock; try restarting transaction at /usr/local/share/perl/5.30.0/Apache/Ocsinventory/Server/Inventory/Software.pm line 59.![mysql_failed](https://user-images.githubusercontent.com/15703383/168803001-24477535-6ecb-4508-9100-1eb069583f59.JPG)