Bug 9135 - updatedatabase.pl fails when DEBUG is set
Summary: updatedatabase.pl fails when DEBUG is set
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker (vote)
Assignee: Jared Camins-Esakov
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-23 17:30 UTC by Jared Camins-Esakov
Modified: 2019-06-27 09:24 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9135: updatedatabase.pl fails when DEBUG is set (1.15 KB, patch)
2012-11-23 18:02 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 9135: updatedatabase.pl fails when DEBUG is set (1.34 KB, patch)
2012-12-01 20:07 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9135: updatedatabase.pl fails when DEBUG is set (1.45 KB, patch)
2012-12-03 09:43 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2012-11-23 17:30:11 UTC
When there is a duplicate syspref and DEBUG is set, updatedatabase.pl dies early, resulting in an endless loop of not getting the system updated.
Comment 1 Jared Camins-Esakov 2012-11-23 18:02:42 UTC Comment hidden (obsolete)
Comment 2 Jared Camins-Esakov 2012-11-30 23:09:30 UTC
Upgrading this to BLOCKER because when the RM isn't happy, nobody is happy.
Comment 3 Jared Camins-Esakov 2012-11-30 23:14:44 UTC
The easiest way to test this is to set your database version back, then run from the command line:
export DEBUG=1
installer/data/mysql/updatedatabase.pl

Without the patch, you won't get through the upgrade.
Comment 4 Katrin Fischer 2012-12-01 20:07:58 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2012-12-03 09:43:29 UTC
Created attachment 13837 [details] [review]
Bug 9135: updatedatabase.pl fails when DEBUG is set

When the DEBUG environment variable is set to a true value, all DBI
errors are treated as fatal. Unfortunately, duplicate keys are
incredibly common in updatedatabase.pl, since sysprefs are often added
in testing, then re-added once the patches have been pushed to master
(or added when on a maintenance branch, and then re-added when the
system is upgraded to either a newer maintenance branch or master).
This patch disables fatal errors for the updatedatabase.pl script.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and perlcritic pass.
To test, run from command line:
export DEBUG=1
installer/data/mysql/updatedatabase.pl

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
If a query causes an error, the script continues as expected.
Comment 6 Jared Camins-Esakov 2012-12-03 11:25:46 UTC
This patch has been pushed to master.
Comment 7 Chris Cormack 2012-12-05 02:53:03 UTC
Pushed to 3.10.x and 3.8.x, will be in 3.10.1 and 3.8.8