Bug 30946 - Error in database update 21.12.00.048
Summary: Error in database update 21.12.00.048
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: 22.05
Hardware: All All
: P5 - low critical (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 30291
Blocks:
  Show dependency treegraph
 
Reported: 2022-06-10 23:29 UTC by victor
Modified: 2023-06-08 22:26 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description victor 2022-06-10 23:29:30 UTC
$koha-upgrade-schema library
Upgrading database schema for bibliotecateste
Upgrade to 21.12.00.048  [20:27:10]: Bug 30291 - Renaming recalls table columns
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot drop index 'borrowernumber': needed in a foreign key constraint at /usr/share/koha/lib/C4/Installer.pm line 739
Comment 1 Katrin Fischer 2022-06-11 16:58:20 UTC
From which version did you update from?
Comment 2 victor 2022-06-11 17:08:15 UTC
(In reply to Katrin Fischer from comment #1)
> From which version did you update from?

Ubuntu 20.04.4 LTS

mysql  Ver 15.1 Distrib 10.4.14-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Koha 22.05
Comment 3 victor 2022-06-11 17:09:43 UTC
(In reply to victor from comment #2)
> (In reply to Katrin Fischer from comment #1)
> > From which version did you update from?
> 
> Ubuntu 20.04.4 LTS
> 
> mysql  Ver 15.1 Distrib 10.4.14-MariaDB, for debian-linux-gnu (x86_64) using
> readline 5.2
> 
> Koha 22.05

Koha 21.11 upgrade to 22.05
Comment 4 victor 2022-06-12 13:08:33 UTC
In addition to presenting an error when trying to restart the bases.

Upgrade to 21.12.00.048  [20:27:10]: Bug 30291 - Renaming recalls table columns
ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Cannot drop index 'borrowernumber': needed in a foreign key constraint at /usr/share/koha/lib/C4/Installer.pm line 739

The interfaces are returning to the installation screen.
https://mydomain/cgi-bin/koha/installer/install.pl?step=1&op=updatestructure


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

Koha 22.05

Installation with multiple instances
Comment 5 victor 2022-06-12 23:26:31 UTC
apparent solution

mysql >USE database;
mysql >SET foreign_key_checks = 0;
mysql > ALTER TABLE recalls CHANGE COLUMN borrowernumber patron_id int(11) NOT NULL DEFAULT 0;
Comment 6 Jonathan Druart 2022-06-13 09:04:57 UTC
Cannot recreate on 10.5.16-MariaDB-1
Comment 7 Nick Clemens 2022-06-13 19:46:23 UTC
Cannot recreate on 
Server version: 5.5.5-10.4.25-MariaDB-1:10.4.25+maria~focal mariadb.org binary distribution
Comment 8 Nick Clemens 2022-06-13 19:50:31 UTC
https://jira.mariadb.org/browse/MDEV-22775
Comment 9 victor 2022-06-13 20:00:59 UTC
(In reply to Jonathan Druart from comment #6)
> Cannot recreate on 10.5.16-MariaDB-1

Sorry but I did not understand,
There's no solution for the version of the bank I'm using?
Comment 10 Fridolin Somers 2022-06-13 20:08:57 UTC
(In reply to victor from comment #4)
> 
> 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
> 

Hi,

We have servers with Ubuntu 20.04 Focal and MariaDB 10.4.
Can't reproduce.

I see Ubuntu package is on MariaDB 10.3 :
https://packages.ubuntu.com/search?suite=focal-updates&searchon=names&keywords=mariadb-server

We install mariaDB with its repo :
deb [arch=amd64,arm64] https://downloads.mariadb.com/MariaDB/mariadb-10.4/repo/ubuntu focal main
And we hace 10.4.25-MariaDB.

How did you install MariaDB ? 10.4.14 is quite late.
Comment 11 victor 2022-06-13 20:41:08 UTC
(In reply to Fridolin Somers from comment #10)
> (In reply to victor from comment #4)
> > 
> > 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
> > 
> 
> Hi,
> 
> We have servers with Ubuntu 20.04 Focal and MariaDB 10.4.
> Can't reproduce.
> 
> I see Ubuntu package is on MariaDB 10.3 :
> https://packages.ubuntu.com/search?suite=focal-
> updates&searchon=names&keywords=mariadb-server
> 
> We install mariaDB with its repo :
> deb [arch=amd64,arm64]
> https://downloads.mariadb.com/MariaDB/mariadb-10.4/repo/ubuntu focal main
> And we hace 10.4.25-MariaDB.
> 
> How did you install MariaDB ? 10.4.14 is quite late.

So should I upgrade to version 10.4.25-MariaDB?
Could this cause any problems with koha installations?
And that should solve my problem?
Comment 12 victor 2022-06-13 22:23:11 UTC
(In reply to victor from comment #11)
> (In reply to Fridolin Somers from comment #10)
> > (In reply to victor from comment #4)
> > > 
> > > 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
> > > 
> > 
> > Hi,
> > 
> > We have servers with Ubuntu 20.04 Focal and MariaDB 10.4.
> > Can't reproduce.
> > 
> > I see Ubuntu package is on MariaDB 10.3 :
> > https://packages.ubuntu.com/search?suite=focal-
> > updates&searchon=names&keywords=mariadb-server
> > 
> > We install mariaDB with its repo :
> > deb [arch=amd64,arm64]
> > https://downloads.mariadb.com/MariaDB/mariadb-10.4/repo/ubuntu focal main
> > And we hace 10.4.25-MariaDB.
> > 
> > How did you install MariaDB ? 10.4.14 is quite late.
> 
> Install with sudo apt install mariadb-server
Not really I believe it is not in the repo
Comment 13 victor 2022-06-13 22:29:33 UTC
(In reply to victor from comment #12)
> (In reply to victor from comment #11)
> > (In reply to Fridolin Somers from comment #10)
> > > (In reply to victor from comment #4)
> > > > 
> > > > 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
> > > > 
> > > 
> > > Hi,
> > > 
> > > We have servers with Ubuntu 20.04 Focal and MariaDB 10.4.
> > > Can't reproduce.
> > > 
> > > I see Ubuntu package is on MariaDB 10.3 :
> > > https://packages.ubuntu.com/search?suite=focal-
> > > updates&searchon=names&keywords=mariadb-server
> > > 
> > > We install mariaDB with its repo :
> > > deb [arch=amd64,arm64]
> > > https://downloads.mariadb.com/MariaDB/mariadb-10.4/repo/ubuntu focal main
> > > And we hace 10.4.25-MariaDB.
> > > 
> > > How did you install MariaDB ? 10.4.14 is quite late.
> > 
> > Install with sudo apt install mariadb-server
> Not really I believe it is not in the repo

Does koha 22.05 with Ubuntu 20.04 and 10.4.25-MariaDB work correctly?
Comment 14 Fridolin Somers 2022-06-14 06:47:06 UTC
(In reply to victor from comment #11)
> 
> So should I upgrade to version 10.4.25-MariaDB?
> Could this cause any problems with koha installations?
> And that should solve my problem?
I hope so.

What says :
apt-cache policy mariadb-server
Comment 15 Jonathan Druart 2022-06-16 09:29:05 UTC
Update your system and it should fix the problem.