ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry '10434' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 739 How to fix this one?
for KOHA version 22.05 ( upgrade from 20.05 to 22.05)
What are the lines before and after the error? It's easier to see what's going wrong if we have the number of the update.
Im not that good in MySQL, can i ask how can i locate the lines before and after the error? the KOHA version im going to update is 20.05( i already fix the first bug i found in my update using this (MariaDB [koha]> SELECT language_subtag,GROUP_CONCAT(script_subtag SEPARATOR ' | '),COUNT(*) AS nb\ -> FROM language_script_mapping GROUP BY language_subtag HAVING nb > 1; +-----------------+---------------------------------------------+----+ | language_subtag | GROUP_CONCAT(script_subtag SEPARATOR ' | ') | nb | +-----------------+---------------------------------------------+----+ | ar | Arab | Arab | 2 | | he | Hebr | Hebr | 2 | +-----------------+---------------------------------------------+----+ And fix with : DELETE FROM language_script_mapping WHERE language_subtag = 'ar' LIMIT 1 ; DELETE FROM language_script_mapping WHERE language_subtag = 'he' LIMIT 1 ;) but after this one the next error bug appears. (ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry '10434' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 739) Please help me in finding the error.
What I meant was the lines in the error output. The installer will usually tell you what updates were done and where the error occurred, the database update version, which is the third number, like i.e. 22.04.023, but may it differs when using the web installer and older versions. Without a table or anything as a clue, I have no idea what the duplicate key refers to. :(
Added new system preference 'UseOCLCEncodingLevels' Upgrade to 22.06.00.056 [12:00:42]: Bug 30571 - Table z3950servers: three cols NOT NULL Upgrade to 22.06.00.057 [12:00:42]: Bug 29071 - Set HoldsQueueSplitNumbering wh ere not set Added new system preference 'HoldsSplitQueueNumbering' Upgrade to 22.06.00.058 [12:00:42]: Bug 30944 - Replace branchtransfers.cancell ation_reason CancelRecall with RecallCancellation Upgrade to 22.06.00.059 [12:00:42]: Bug 25936 - A password change notification feature Added new letter 'PASSWORD_CHANGE' (email) Added new system preference 'NotifyPasswordChange' Upgrade to 22.06.00.060 [12:00:42]: Bug 10950 - Add preferred pronoun field to patron record Added column 'borrowers.pronouns' Added column 'deletedborrowers.pronouns' Added column 'borrower_modifications.pronouns' Upgrade to 22.06.00.061 [12:00:42]: Bug 31333 - Add the ability to limit purcha se suggestions by patron category Added new system preference 'suggestionPatronCategoryExceptions' Upgrade to 22.06.00.062 [12:00:42]: Bug 27136 - Add missing languages: Cree, Af rikaans and Multiple languages, Undetermined and No linguistic content Added missing languages Upgrade to 22.06.00.063 [12:00:43]: Bug 31569 - Add primary key for import_bibl ios ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry '104 34' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 739 Enabling plugins on node rabbit@lrc: rabbitmq_stomp The following plugins have been configured: rabbitmq_stomp Applying plugin configuration to rabbit@lrc... The following plugins have been enabled: rabbitmq_stomp started 1 plugins. Failed to enable unit: Unit /run/systemd/generator.late/koha-common.service is transient or generated. Here is the result of upgrade and the error.
(In reply to quickfire28 from comment #6) > > > Added new system preference 'UseOCLCEncodingLevels' > Upgrade to 22.06.00.056 [12:00:42]: Bug 30571 - Table z3950servers: three > cols > NOT NULL > Upgrade to 22.06.00.057 [12:00:42]: Bug 29071 - Set > HoldsQueueSplitNumbering wh > ere not set > Added new system preference 'HoldsSplitQueueNumbering' > Upgrade to 22.06.00.058 [12:00:42]: Bug 30944 - Replace > branchtransfers.cancell > ation_reason CancelRecall with RecallCancellation > Upgrade to 22.06.00.059 [12:00:42]: Bug 25936 - A password change > notification > feature > Added new letter 'PASSWORD_CHANGE' (email) > Added new system preference 'NotifyPasswordChange' > Upgrade to 22.06.00.060 [12:00:42]: Bug 10950 - Add preferred pronoun field > to > patron record > Added column 'borrowers.pronouns' > Added column 'deletedborrowers.pronouns' > Added column 'borrower_modifications.pronouns' > Upgrade to 22.06.00.061 [12:00:42]: Bug 31333 - Add the ability to limit > purcha > se suggestions by patron category > Added new system preference 'suggestionPatronCategoryExceptions' > Upgrade to 22.06.00.062 [12:00:42]: Bug 27136 - Add missing languages: > Cree, Af > rikaans and Multiple languages, Undetermined and No linguistic content > Added missing languages > Upgrade to 22.06.00.063 [12:00:43]: Bug 31569 - Add primary key for > import_bibl > ios > ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry > '104 > 34' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 739 > > Enabling plugins on node rabbit@lrc: > rabbitmq_stomp > The following plugins have been configured: > rabbitmq_stomp > Applying plugin configuration to rabbit@lrc... > The following plugins have been enabled: > rabbitmq_stomp > > started 1 plugins. > Failed to enable unit: Unit /run/systemd/generator.late/koha-common.service > is transient or generated. > > > Here is the result of upgrade and the error. I dont know how to check which table is affected with that error in upgrade.
Here is the table that has Duplicate entry error - {unknown}: dbi exception: dbd::mysql::db do failed: duplicate entry '24690' for key 'import_biblios.primary' at /usr/share/koha/lib/c4/installer.pm line 739 and even the biblios in Reservoir detected as Duplicate entry.
*** Bug 33034 has been marked as a duplicate of this bug. ***
Still looking for help in this error while upgrading from v20.05 to v22.11.
(In reply to quickfire28 from comment #8) > Here is the table that has Duplicate entry > > error - {unknown}: dbi exception: dbd::mysql::db do failed: duplicate entry > '24690' for key 'import_biblios.primary' at > /usr/share/koha/lib/c4/installer.pm line 739 > > > and even the biblios in Reservoir detected as Duplicate entry. I already fixed this error by accessing the database using HeidiSQl then locate and clear the import_biblios table.