[Bug 43231] New: Bug 40658 breaks CLI for 25.11
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 Bug ID: 43231 Summary: Bug 40658 breaks CLI for 25.11 Initiative type: --- Sponsorship Sponsored status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Keywords: rel_25_11_candidate Severity: blocker Priority: P5 - low Component: Installation and upgrade (command-line installer) Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: aleisha@catalyst.net.nz, dghdghfghfgh04@gmail.com, lucas@bywatersolutions.com, mark@hofstetter.at, martin.renvoize@openfifth.co.uk, nick@bywatersolutions.com, pedro.amorim@openfifth.co.uk, tomascohen@gmail.com Depends on: 40658, 42795 Target Milestone: --- +++ This bug was initially created as a clone of Bug #42795 +++ This happened when trying to upgrade one of our Koha instances from Koha 25.11.04 to 25.11.05: Upgrade to 25.11.04.011 [18:49:23]: Bug 40658 - Ensure local-number is sortable ERROR: Exception 'Koha::Exception' thrown 'Unable to update mappings for index "koha_cust_biblios". Reason was: "mapper [local-number] cannot be changed from type [integer] to [text]". Index needs to be recreated and reindexed' So.. somehow the type is wrong in the index itself which makes me think we need to better catch that case and trigger a full re-index in a background task or something instead when that happens. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40658 [Bug 40658] When sorting by local-number we should use the sort field https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42795 [Bug 42795] Bug 40658 breaks CLI for 25.11 -- 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=43231 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|Sponsored |Unsponsored -- 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=43231 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=43231 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 203177 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203177&action=edit Bug 43231: Don't let a failed ES mapping update abort the DB upgrade The atomic update for bug 40658 (making local-number sortable) calls Koha::SearchEngine::Elasticsearch::Indexer->update_mappings() directly whenever Elasticsearch is enabled. If the existing index already has local-number mapped as a plain integer (as it did before local-number was made sortable), Elasticsearch refuses the in-place mapping change: mapper [local-number] cannot be changed from type [integer] to [text] update_mappings() catches that internally and marks the index status as needing a full recreate/reindex, but it then re-throws, so the exception was left to propagate out of the atomic update and abort the whole schema upgrade - even though Elasticsearch was enabled and otherwise working fine, and even though the failure is a known, already-handled case. Wrap the call in try/catch so a mapping failure only produces a warning in the upgrade output, and the schema upgrade continues. The "index needs to be recreated" status set by update_mappings() is already surfaced by admin/searchengine/elasticsearch/mappings.pl and acted on by misc/search_tools/rebuild_elasticsearch.pl, so no extra plumbing is needed to alert admins or fix the index afterwards. Test plan: 1. On an instance with Elasticsearch enabled and biblios indexed, force local-number's mapping to a non-sortable type, e.g.: PUT /koha_kohadev_biblios/_mapping { "properties": { "local-number": { "type": "integer" } } } 2. Roll the DB version back before 25.12.00.059 and re-run updatedatabase.pl (or koha-upgrade-schema) so it re-applies this revision. 3. Without this patch: the upgrade aborts with the Koha::Exception above and no later DB revisions are applied. 4. With this patch: the upgrade prints a warning and continues; later revisions still apply. admin/searchengine/elasticsearch/mappings.pl shows the biblios index as needing to be recreated. 5. Run misc/search_tools/rebuild_elasticsearch.pl -r -b to fix the index, confirm the warning clears. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_26_05_candidate, | |rel_26_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |26.11 Version|Main |25.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Setting Version to 25.11 as it's especially problematic at that point.. but it'll need applying to all branches 25.11 upwards -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Happy to attempt a sign off, but I have no idea how to do steps 1 and 2. I tried the following, but this doesn't work to generate the error: 1. Start up KTD with Elasticsearch: ktd --search-engine es9 up 2. Access the KTD shell: ktd --shell 3. Check out Koha 25.11: - git checkout 25.11.x 4. Change Elasticsearch mapping for local-number: - Edit admin/searchengine/elasticsearch/mappings.yaml - Change the two entries for local-number (note: integer is not used as a type anywhere else in the file): . type: number to type: integer 5. Reset everything so the database structure is changed to 25.11.x: reset_all 6. Simulate an upgrade: - updatedatabase OR - sudo koha-upgrade-schema kohadev -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Bug 40658 breaks CLI for |Bug 40658 still breaks CLI |25.11 |for 25.11 after Bug 42795 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43231 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- I've updated the bug title since it was a duplicate bug title with bug 42795... please correct if I'm wrong there... -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org