[Bug 30951] New: Duplicate entry 'ar' for key 'PRIMARY'
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 Bug ID: 30951 Summary: Duplicate entry 'ar' for key 'PRIMARY' Change sponsored?: --- Product: Koha Version: 22.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: vbovictor@gmail.com QA Contact: testopia@bugs.koha-community.org In Ubuntu 20.04.4 LTS mysql Ver 15.1 Distrib 10.4.14-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 ERROR koha-upgrade-schema library Upgrade to 21.12.00.013 [19:25:20]: Bug 29605 - Resync DB structure for existing installations ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry 'ar' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 739 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #1 from victor <vbovictor@gmail.com> --- Version Koha 22.05 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29605 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29605 [Bug 29605] DB structure may not be synced with kohastructure.sql -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |critical -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Hi, We have seen this one only once, on a very old database (started at 3.2). We detect it with : 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 ; -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #3 from victor <vbovictor@gmail.com> --- (In reply to Fridolin Somers from comment #2)
Hi,
We have seen this one only once, on a very old database (started at 3.2).
We detect it with : 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 ;
Thank you very much! The issue was resolved with your guidance. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Cheers, Fridolin. Just bumped into this one myself, so your fix was very helpful! I was tempted to close the issue but really this is something that Bug 29605 should've watched out for I suppose... I'm not sure what the answer is for fixing an old database migration... I suppose we would need to fix /usr/share/koha/intranet/cgi-bin/installer/data/mysql/db_revs/211102003.pl since ordering is critical... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Could we fix the old database update and implement the proposed fix as a new one to catch all? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #5)
Could we fix the old database update and implement the proposed fix as a new one to catch all?
Makes sense to me. I'm just not sure how we do that as a process. Do we do a patch against master for the database update (for the past), and then stable branches backport it? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #6)
(In reply to Katrin Fischer from comment #5)
Could we fix the old database update and implement the proposed fix as a new one to catch all?
Makes sense to me. I'm just not sure how we do that as a process. Do we do a patch against master for the database update (for the past), and then stable branches backport it?
I'd say so. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- I was looking at this one again... It looks like installer/data/mysql/mandatory/subtag_registry.sql inserts entries into language_script_mapping, and updatedatabase.pl inserts the same entries in version "3.00.00.045". The git history for installer/data/mysql/mandatory/subtag_registry.sql is super weird... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #8)
I was looking at this one again...
It looks like installer/data/mysql/mandatory/subtag_registry.sql inserts entries into language_script_mapping, and updatedatabase.pl inserts the same entries in version "3.00.00.045".
Hm, but is this a problem? subtag_registry.sql should only be used for new installations, updatedatabase only run for updates... might be missing something?
The git history for installer/data/mysql/mandatory/subtag_registry.sql is super weird...
-- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #9)
Hm, but is this a problem? subtag_registry.sql should only be used for new installations, updatedatabase only run for updates... might be missing something?
Probably not. I can't figure out how duplicate entries are getting created... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|22.05 |unspecified CC| |jonathan.druart+koha@gmail. | |com Severity|critical |normal --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I've tried an upgrade from v3.0.6, then updatedatabase, and the query does not return anything. Lowering severity. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 143787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143787&action=edit diff to run updatedatabase from v3.0.6 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 143788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143788&action=edit output of updatedatabase from v3.0.6 to 22.06.00.083 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- For those wondering, see last two attachments. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 quickfire28@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |quickfire28@gmail.com --- Comment #15 from quickfire28@gmail.com --- (In reply to victor from comment #3)
(In reply to Fridolin Somers from comment #2)
Hi,
We have seen this one only once, on a very old database (started at 3.2).
We detect it with : 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 ;
Thank you very much! The issue was resolved with your guidance.
Good day! I tried to use this fix on my KOHA, and the update works. but when i use patron seach on koha web and try to open the patron list it gives an error 500. or when type name of patron on search bar and hit enter it also gives error 500. Thank you! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #16 from quickfire28@gmail.com --- Its for KOHA version 21.05 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to quickfire28 from comment #15)
(In reply to victor from comment #3)
(In reply to Fridolin Somers from comment #2)
Hi,
We have seen this one only once, on a very old database (started at 3.2).
We detect it with : 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 ;
Thank you very much! The issue was resolved with your guidance.
Good day!
I tried to use this fix on my KOHA, and the update works. but when i use patron seach on koha web and try to open the patron list it gives an error 500.
or when type name of patron on search bar and hit enter it also gives error 500.
Thank you!
I believe these are unrelated - the error you see is unlikely to be linked to the change to languages. Please try the mailing list with a description of your issue. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30951 Indranil Das Gupta <indradg@l2c2.co.in> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |indradg@l2c2.co.in --- Comment #18 from Indranil Das Gupta <indradg@l2c2.co.in> --- Just ran into this problem on a 20.05.18 db dump. TBH, the site was running on Koha since 2014 / 15, so possibly an artifact from yore. FWIW, fridolin's corrective SQL snippet helped me sort this out. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org