Bug 40125

Summary: Debian package upgrade from 24.11.03-3 to 25.05.00-2. failed with mysql error while applying fix for bug 32630
Product: Koha Reporter: cgr <riches-cg>
Component: Installation and upgrade (command-line installer)Assignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: critical    
Priority: P2 CC: tomascohen
Version: 25.05   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description cgr 2025-06-11 21:55:21 UTC
I upgraded my Koha installation from version 24.11.03-3 to version 25.05.00-2.  The installation failed with a mysql syntax error while trying to apply the fix for bug 38663.
I've not found anyone who's run into this issue and can use some help.

Here's the apt-get command I used for the installation:

[root@kohabox ~]# apt-get dist-upgrade koha-common koha-l10n
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  git git-man liberror-perl libfile-chdir-perl libgit-wrapper-perl
  libsort-versions-perl libtest-nowarnings-perl patch
The following packages will be upgraded:
  koha-common koha-l10n
2 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 62.2 MB of archives.
  .
  .
  .
  .

After upgrading the packages, the installation proceeds to upgrade the db schema:

Upgrading database schema for richeslibrary
Upgrade to 24.12.00.000  [13:06:40]: Increase DBRev for 24.12
	🚧 Let's do this.
Upgrade to 24.12.00.001  [13:06:40]: Bug 38522 - Increase erm_agreements.license_info length
	Updated erm_agreements.license_info to mediumtext.
Upgrade to 24.12.00.002  [13:06:40]: Bug 37292 - Add index on 'oauth_access_tokens.expires'
Upgrade to 24.12.00.003  [13:06:40]: Bug 33268 - Add rules to preserve current MARC record overlay rules behavior
	Added record overlay rules to preserve current behavior
Upgrade to 24.12.00.004  [13:06:41]: Bug 35154 - Move StaffLoginInstructions to additional contents
	Removed system preference 'StaffLoginInstructions'
Upgrade to 24.12.00.005  [13:06:41]: Bug 35152 - Move RoutingListNote to additional contents
	Added 'RoutingListNote' HTML customization
	Removed system preference 'RoutingListNote'
Upgrade to 24.12.00.006  [13:06:41]: Bug 38794 - Update description of authorized value AggregatedFullText
	Updated description of authorized value AggregatedFullText
Upgrade to 24.12.00.007  [13:06:41]: Bug 30300 - Add 'patron expiry' to messaging preferences
	Message attribute 'Patron_Expiry' added
	MEMBERSHIP_EXPIRY added to message_transports
Upgrade to 24.12.00.008  [13:06:41]: Bug 35028 - Add system preference 'PatronSelfRegistrationAlert'
	Added new system preference 'PatronSelfRegistrationAlert'
Upgrade to 24.12.00.009  [13:06:41]: Bug 36954 - Adjustment for logfiles in koha-sip
	IMPORTANT: If you use SIP, please edit your /etc/koha/sites/[CLONE]/log4perl.conf at upgrade time.
	Replace sip.log there by sip-output.log.
Upgrade to 24.12.00.010  [13:06:41]: Bug 35635 - Add opac_mandatory column to borrower_attribute_type table
	Modified column 'borrower_attribute_types.mandatory'
	Added column 'borrower_attribute_types.opac_mandatory'
	Update opac_mandatory to match mandatory column
Upgrade to 24.12.00.011  [13:06:41]: Bug 26684 - Drop marc column from auth_header
	Removed column 'auth_header.marc'
Upgrade to 24.12.00.012  [13:06:41]: Bug 30888 - Add table deletedauth_header
	Added new table 'deletedauth_header'
Upgrade to 24.12.00.013  [13:06:41]: Bug 38689 - Add edifact_errors table to record edifact error messages
	Added new table 'edifect_errors'
Upgrade to 24.12.00.014  [13:06:41]: Bug 38108 - Add AlwaysShowHoldingsTableFilters system preference
	Added new system preference 'AlwaysShowHoldingsTableFilters'
Upgrade to 24.12.00.015  [13:06:41]: Bug 39075 - Follow up for bug 34587 to fix incorrect default values for timestamps
	Successfully corrected incorrect default value for 'erm_counter_files.date_uploaded
	Successfully corrected incorrect default value for 'erm_counter_logs.importdate
Upgrade to 24.12.00.016  [13:06:41]: Bug 36833 - Add German translations for new languages
	Added German translations for new languages
	Updated German translation for Latin
Upgrade to 24.12.00.017  [13:06:41]: Bug 32630 - Don't delete illrequests when borrower is deleted
	Updated borrowernumber constraint on illrequests table
Upgrade to 24.12.00.018  [13:06:41]: Bug 38663 - Add additional fields to libraries
	Converting record_id from int(11) to VARCHAR(11)...
	
	ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COLUMN new_record_id TO record_id' at line 1 at /usr/share/koha/lib/C4/Installer.pm line 825
	
dpkg: error processing package koha-common (--configure):
 installed koha-common package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.8.5-2+deb10u1) ...
Processing triggers for systemd (241-7~deb10u10) ...
Errors were encountered while processing:
 koha-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
[root@kohabox ~]# 


And that's where things end....  Any ideas on how to proceed?

Thanks!