Bug 24292 - Upgrade failed, from 19.05 to 19.11 on Ubuntu 19.10: Can't load Unaccent.so
Summary: Upgrade failed, from 19.05 to 19.11 on Ubuntu 19.10: Can't load Unaccent.so
Status: RESOLVED DUPLICATE of bug 14759
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: 19.11
Hardware: PC Linux
: P4 minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-21 15:25 UTC by mjnkml
Modified: 2020-01-17 11:41 UTC (History)
7 users (show)

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


Attachments
Bug 24296: Update existing data in the database (2.99 KB, patch)
2020-01-17 11:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 24296: Update stockrotation process to use branchtransfers.trigger (5.19 KB, patch)
2020-01-17 11:40 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description mjnkml 2019-12-21 15:25:44 UTC
Upgrading koha using apt update from (presumably) 19.05 to 19.11 failed:

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up koha-common (19.11.00-1) ...
Upgrading database schema for instance
Can't load '/usr/lib/x86_64-linux-gnu/perl5/5.28/auto/Text/Unaccent/Unaccent.so' for module Text::Unaccent: /usr/lib/x86_64-linux-gnu/perl5/5.28/auto/Text/Unaccent/Unaccent.so: undefined symbol: unac_debug_callback at /usr/lib/x86_64-linux-gnu/perl/5.28/DynaLoader.pm line 187.
 at /usr/share/koha/lib/Koha/Patron.pm line 26.
Compilation failed in require at /usr/share/koha/lib/Koha/Patron.pm line 26.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Patron.pm line 26.
Compilation failed in require at /usr/share/koha/lib/Koha/Patrons.pm line 30.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Patrons.pm line 30.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkouts/ReturnClaim.pm line 27.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkouts/ReturnClaim.pm line 27.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkouts/ReturnClaims.pm line 26.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkouts/ReturnClaims.pm line 26.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkout.pm line 27.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkout.pm line 27.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkouts.pm line 25.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkouts.pm line 25.
Compilation failed in require at /usr/share/koha/lib/C4/Auth.pm line 37.
BEGIN failed--compilation aborted at /usr/share/koha/lib/C4/Auth.pm line 37.
Compilation failed in require at /usr/share/koha/lib/C4/Output.pm line 34.
BEGIN failed--compilation aborted at /usr/share/koha/lib/C4/Output.pm line 34.
Compilation failed in require at /usr/share/koha/lib/Koha/Plugins.pm line 29.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Plugins.pm line 29.
Compilation failed in require at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 18792.
dpkg: error processing package koha-common (--configure):
 installed koha-common package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 koha-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

$

The only way I could get it to move forward was to comment out the use Unaccent on line 26, and also comment out the part that actually uses the function.

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:        19.10
Codename:       eoan
> uname -a
Linux koha 5.3.0-23-generic #25-Ubuntu SMP Tue Nov 12 09:22:33 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 mjnkml 2019-12-21 15:34:35 UTC
In Koha's About -> Perl moduls page, Text::Unaccent is shown Installed at version 1.08.
Comment 3 Katrin Fischer 2019-12-22 09:44:50 UTC
Could the last comment on bug 14759 be related to this?
Also linking them with see also.
Comment 4 Marcel de Rooy 2019-12-23 10:30:25 UTC
(In reply to Katrin Fischer from comment #3)
> Could the last comment on bug 14759 be related to this?
> Also linking them with see also.

Yes, seems to be the same thing.
Comment 5 Colin Campbell 2020-01-08 16:21:00 UTC
Ubuntu has a newer version of perl than debian Text::Unaccent cant be build on perl after 5.26 (and earlier on many environments). You can confirm this is the problem by installing Text::Unaccent::PurePerl and changing the use Text::Unaccent in Koha::Patron.pm to use that - the errors should then disappear
Comment 6 Katrin Fischer 2020-01-08 20:20:59 UTC
(In reply to Marcel de Rooy from comment #4)
> (In reply to Katrin Fischer from comment #3)
> > Could the last comment on bug 14759 be related to this?
> > Also linking them with see also.
> 
> Yes, seems to be the same thing.

Marking as duplicate as the ohter has a patch to get rid of the problematic library.

*** This bug has been marked as a duplicate of bug 14759 ***
Comment 7 Rudolf Byker 2020-01-15 06:44:38 UTC
I just ran into the same thing today. Is there a way to recover from the failed update?
Comment 8 Katrin Fischer 2020-01-15 06:53:39 UTC
(In reply to Rudolf Byker from comment #7)
> I just ran into the same thing today. Is there a way to recover from the
> failed update?

Hi Rudolf, this has been marked as a duplicate of bug 14759 which has the fix we have been working on. Not sure where your update failed - if it was the dependency check on the web installer you can probably apply the patch and it will work from there as no database update has been run yet.
Comment 9 Rudolf Byker 2020-01-15 07:00:10 UTC
It failed suring "sudo apt upgrade" on a Debian system. That's how I always update Koha (and everything else):

Setting up koha-common (19.11.01-1) ...
Installing new version of config file /etc/init.d/koha-common ...
Installing new version of config file /etc/koha/koha-conf-site.xml.in ...
Installing new version of config file /etc/koha/plack.psgi ...
Upgrading database schema for rsc
Upgrade to 19.06.00.000 done (Wingardium Leviosa!)
Upgrade to 19.06.00.001 done (Bug 22960: Fix typo in syspref description)
Upgrade to 19.06.00.002 done (Bug 10215: Increase the size of opacnote and librariannote for table subscriptionhistory)
Upgrade to 19.06.00.003 done (Bug 22867: UniqueItemFields preference value should be pipe-delimited)
Upgrade to 19.06.00.004 done (Bug 22770: Fix typo in language description for el in German)
Upgrade to 19.06.00.005 done (Bug  9834: Add the reserves.item_level_hold column)
Can't load '/usr/lib/x86_64-linux-gnu/perl5/5.28/auto/Text/Unaccent/Unaccent.so' for module Text::Unaccent: /usr/lib/x86_64-linux-gnu/perl5/5.28/auto/Text/Unaccent/Unaccent.so: undefined symbol: unac_debug_callback at /usr/lib/x86_64-linux-gnu/perl/5.28/DynaLoader.pm line 187.
 at /usr/share/koha/lib/Koha/Patron.pm line 26.
Compilation failed in require at /usr/share/koha/lib/Koha/Patron.pm line 26.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Patron.pm line 26.
Compilation failed in require at /usr/share/koha/lib/Koha/Patrons.pm line 30.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Patrons.pm line 30.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkouts/ReturnClaim.pm line 27.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkouts/ReturnClaim.pm line 27.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkouts/ReturnClaims.pm line 26.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkouts/ReturnClaims.pm line 26.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkout.pm line 27.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkout.pm line 27.
Compilation failed in require at /usr/share/koha/lib/Koha/Checkouts.pm line 25.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Checkouts.pm line 25.
Compilation failed in require at /usr/share/koha/lib/C4/Auth.pm line 37.
BEGIN failed--compilation aborted at /usr/share/koha/lib/C4/Auth.pm line 37.
Compilation failed in require at /usr/share/koha/lib/C4/Output.pm line 34.
BEGIN failed--compilation aborted at /usr/share/koha/lib/C4/Output.pm line 34.
Compilation failed in require at /usr/share/koha/lib/Koha/Plugins.pm line 29.
BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Plugins.pm line 29.
Compilation failed in require at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 18792.
dpkg: error processing package koha-common (--configure):
 installed koha-common package post-installation script subprocess returned error exit status 2
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (241-7~deb10u2) ...
Errors were encountered while processing:
 koha-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

So some DB updates have definitely already run. But, I think I figured out how to salvage it.

As root:

# Install the module
cpan Text::Unaccent::PurePerl
# Edit the perl source, replacing 'Text::Unaccent' with 'Text::Unaccent::PurePerl'
nano /usr/share/koha/lib/Koha/Patron.pm
# Reconfigure failed packages
dpkg --configure --pending

One of the DB updates said: "misc/batchRebuildBiblioTables.pl should be run to populate the fields introduced in bug 11529. It may take some time for larger databases." I'm not sure if this should be run manually, but I tried anyway, without success.

My production DB seems to be working again. I hope this helps someone.
Comment 10 Martin Renvoize 2020-01-15 08:45:10 UTC
I would suggest the best approach is to wait for the release of 19.11.02 in a few days in which this bug is resolved by the removal of the faulty library.

Beware, Koha is not yet officially supported on Debian 10 (Which is what I'm guessing you are using here), there are some security issues and other dependancy problems which are not highlighted as obviously as this one.
Comment 11 Rudolf Byker 2020-01-15 08:51:20 UTC
Unfortunately, waiting was not an option. I have an office full of people waiting to catalog new books on Koha :)

Is Debian 10 not supported yet? That is what I'm using, yes.
Comment 12 Martin Renvoize 2020-01-17 11:40:40 UTC
Created attachment 97502 [details] [review]
Bug 24296: Update existing data in the database

This DB udpate adds the stockration states to the trigger enum in the
branchtransfers table and then populates it with any such data currently
contained within the comments field.
Comment 13 Martin Renvoize 2020-01-17 11:40:44 UTC
Created attachment 97503 [details] [review]
Bug 24296: Update stockrotation process to use branchtransfers.trigger

This patch updates all occurences of stockrotation related lookups of
branchtransfers status from using the 'comments' field to using the new
'trigger' field.

Test plan:
1) Work through the process of creating a stock rotation plan and adding
   items to the plan.. no errors should be encoutered during this process.
2) Run the stockrotation cronjob to move some items on.. no errors
   should be encountered.