[Bug 30539] New: Koha upgrade error "Column 'claimed_on' cannot be null"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 Bug ID: 30539 Summary: Koha upgrade error "Column 'claimed_on' cannot be null" Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Installation and upgrade (command-line installer) Assignee: koha-bugs@lists.koha-community.org Reporter: saiful@semanticconsulting.com QA Contact: testopia@bugs.koha-community.org Running koha-upgrade-schema for migration (from 17.x to 21.x) encountered this error which breaks the upgrade during '19.12.00.085': {UNKNOWN}: DBI Exception: DBD::mysql::st execute failed: Column 'claimed_on' cannot be null at /usr/share/perl5/DBIx/C8. ...[snip]... DBIx::Class::Storage::DBI::__ANON__("DBD::mysql::st execute failed: Column 'claimed_on' cannot be "..., DBI::stundef) called at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 22065 -- 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=30539 --- Comment #1 from Saiful Amin <saiful@semanticconsulting.com> --- There is a possible bug in: /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl (OR [master]/installer/data/mysql/updatedatabase.pl) While checking the code I observed that the orders object has three values and 'claimed_on' is not one of them: 22053 my $orders = $dbh->selectall_arrayref(q| 22054 SELECT ordernumber, claims_count, claimed_date 22055 FROM aqorders So, the possible patch is making following change in the line 22065 of the updatedatabase.pl: 22063 for my $order ( @$orders ) { 22064 for my $claim (1..$order->{claims_count}) { -22065 $insert_claim_sth->execute($order->{ordernumber}, $order->{claimed_on}); +22065 $insert_claim_sth->execute($order->{ordernumber}, $order->{claimed_date}); 22066 } 22067 } The above change fixed the upgrade process for us. -- 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=30539 Saiful Amin <saiful@semanticconsulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Version|unspecified |master CC| |saiful@semanticconsulting.c | |om Severity|enhancement |normal -- 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=30539 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24161 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24161 [Bug 24161] Add ability to track the claim dates of later orders -- 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=30539 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=30539 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 135464 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135464&action=edit Bug 30539: (bug 24161 follow-up) Fix typo in DBrev -- 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=30539 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- As the upgrade process crashes we should be safe and not need to update the existing data. However I am wondering why this hasn't been reported earlier. -- 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=30539 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com Severity|normal |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=30539 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135464|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 135516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135516&action=edit Bug 30539: (bug 24161 follow-up) Fix typo in DBrev Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Testing notes (using koha-testing-docker): - I haven't tested an upgrade from 17.x to 21.x. - I have reviewed the patch and comments - the change resolved the upgrade issue experienced, comments on the original bug. Feel free to change status back to needs sign off, or provide some feedback on how to test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135516|0 |1 is obsolete| | --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 135735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135735&action=edit Bug 30539: (bug 24161 follow-up) Fix typo in DBrev Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This is a data loss bug too. We either didn't notice or didn't have the error, but it results in the claim_dates being replaced with today's date on migration to the new table. Please backport to all necessary releases. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes an upgrade error release notes| |that could result in data | |loss when upgrading from | |earlier releases to 20.05 | |(and later releases). It | |results in the claim_dates | |for orders being replaced | |with the date the upgrade | |was run. (This was caused | |by an error in the database | |update for bug 24161 - Add | |ability to track the claim | |dates of later orders.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.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=30539 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30539 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.03 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.03 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org