Duplicate entry for key 'assets_anr_code_unq' during migration #397
-
|
Hi, I'm trying to upgrade an old version of onarc that hasn't been updated for a long time, I struggled with all the dependencies etc to be able to launch the update script. All this seems to be solve, but now during the migration I have this error : I really have no idea what to do with that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Hi, We had the same problem with our custom databases. With the update to 2.11 I think there was an addition of a Uniq identifier to the database in three tables (assets, threads, vulnerabilities). This is formed by "code" and "ANR_ID". If in the knowledge base in the table "assets" of a risk analysis the code (A-006) occurs several times, the new identifier is no longer unique and therefore runs on an error during the creation. To do this, simply adjust the codes via DB update. The incorrect entries can be identified with the following command: Afterwards the entry can be adjusted with this command. I hope this helps |
Beta Was this translation helpful? Give feedback.

Hi,
We had the same problem with our custom databases. With the update to 2.11 I think there was an addition of a Uniq identifier to the database in three tables (assets, threads, vulnerabilities). This is formed by "code" and "ANR_ID". If in the knowledge base in the table "assets" of a risk analysis the code (A-006) occurs several times, the new identifier is no longer unique and therefore runs on an error during the creation. To do this, simply adjust the codes via DB update.
The incorrect entries can be identified with the following command:
SELECT * from `assets` WHERE `anr_id` = 41 AND `code` LIKE 'A-006%';Afterwards the entry can be adjusted with this command.
UPDATE `assets` SET …