[Bug 30276] New: Web-based installer failing on db upgrade for 30060
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Bug ID: 30276 Summary: Web-based installer failing on db upgrade for 30060 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Installation and upgrade (web-based installer) Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Trying to upgrade a gitified test-install to current master, I get this error: Upgrade to 21.12.00.016 [09:27:15]: Bug 30060 - Update user_permissions to add primary key and remove null option from code column ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'code': used in a foreign key constraint 'user_permissions_ibfk_2' at /home/magnus/kohaclone-sv/C4/Installer.pm line 738 Dropped any previously created primary key ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'code': used in a foreign key constraint 'user_permissions_ibfk_2' at /home/magnus/kohaclone-sv/C4/Installer.pm line 738 Removed any duplicate rows ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot change column 'code': used in a foreign key constraint 'user_permissions_ibfk_2' at /home/magnus/kohaclone-sv/C4/Installer.pm line 738 The table looks like this: MariaDB [koha_koha]> show create table user_permissions\G *************************** 1. row *************************** Table: user_permissions Create Table: CREATE TABLE `user_permissions` ( `borrowernumber` int(11) NOT NULL DEFAULT '0', `module_bit` int(11) NOT NULL DEFAULT '0', `code` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, KEY `user_permissions_ibfk_1` (`borrowernumber`), KEY `user_permissions_ibfk_2` (`module_bit`,`code`), CONSTRAINT `user_permissions_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY (`module_bit`, `code`) REFERENCES `permissions` (`module_bit`, `code`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.00 sec) MariaDB [koha_koha]> describe user_permissions; +----------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+-------------+------+-----+---------+-------+ | borrowernumber | int(11) | NO | MUL | 0 | | | module_bit | int(11) | NO | MUL | 0 | | | code | varchar(64) | YES | | NULL | | +----------------+-------------+------+-----+---------+-------+ 3 rows in set (0.01 sec) And it is currently empty: MariaDB [koha_sverige]> select * from user_permissions; Empty set (0.00 sec) -- 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=30276 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30060 -- 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=30276 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- user_permissions was empty before the upgrade too. Guess this test install only has superlibrarians, no detailed permissions. -- 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=30276 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |major -- 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=30276 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30060 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 [Bug 30060] Missing primary key on user_permissions -- 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=30276 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Keywords| |rel_22_05_candidate -- 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=30276 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- MariaDB [koha_kohadev]> ALTER TABLE user_permissions DROP INDEX IF EXISTS `PRIMARY`; Query OK, 0 rows affected, 1 warning (0.000 sec) Records: 0 Duplicates: 0 Warnings: 1 MariaDB [koha_kohadev]> show warnings; +-------+------+----------------------------------------------------+ | Level | Code | Message | +-------+------+----------------------------------------------------+ | Note | 1091 | Can't DROP 'PRIMARY'; check that column/key exists | +-------+------+----------------------------------------------------+ 1 row in set (0.000 sec) -- 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=30276 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com CC| |sonia.bouis@univ-lyon3.fr -- 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=30276 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 132326 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132326&action=edit Bug 30276: (bug 30060 follow-up) Fix 21.12.00.016 ERROR 1832 (HY000): Cannot change column 'code': used in a foreign key constraint 'user_permissions_ibfk_2' Test plan: Checkout a commit prior to 30060 (c023f63abcce53d71c9492aea4bc7aa30fdc5d73) reset_all checkout master+this patch updatedatabase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |blocker -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |kyle@bywatersolutions.com Status|Pushed to master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_22_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org