Summary: | ElasticSearch Indexer crashes on authtypecode NAME_EVENT | ||
---|---|---|---|
Product: | Koha | Reporter: | Thomas Klausner <domm> |
Component: | Searching - Elasticsearch | Assignee: | Thomas Klausner <domm> |
Status: | Failed QA --- | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | domm, nick, phil |
Version: | Main | ||
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: | ||
Bug Depends on: | 21958 | ||
Bug Blocks: | |||
Attachments: | Skip unknown authtypes instead of dying |
Description
Thomas Klausner
2022-05-05 12:57:20 UTC
Created attachment 134639 [details] [review] Skip unknown authtypes instead of dying Fixes the bug... Test Plan: * Confirm that you do not have an authtype 'NAME_EVENT' (either in the DB or /cgi-bin/koha/admin/authtypes.pl * Enable ElasticSearch * Create or edit an authoritiy record of type 'MEETI_NAME', make sure that 111 is empty, and 147 has some content (you might even need to fiddle with the frameworks to show the 147 form in the editor) * Note the ID of the auth record * Run the ES indexer, limited on the auth id: bin/search_tools/rebuild_elasticsearch.pl -a -v -ai $YOUR_AUTH_ID * The script will die with a message like: [2374] Committing final records... Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /usr/share/koha/lib/C4/Heading.pm line 71. Now apply the patch. * Run ES indexer again * It should now report something like [2374] Committing final records... Cannot handle authority type NAME_EVENT for record: 1046314. It seems like this authority type is not defined in your instance at /usr/share/koha/lib/Koha/SearchEngine/Elasticsearch.pm line 566. [2374] Total 1 records indexed Sponsored-by: Steiermärkische Landesbibliothek Test plan can't go in that order, because GuessAuthTypeCode runs and we throw when you save the authority record. So it has to be * Leave SearchEngine set to Zebra * Edit MEETI_NAME framework, uncheck Mandatory for tag 111 * Create authority with 147 and no 111 * Switch SearchEngine to ElasticSearch, reindex Seems like a bug that we include 147 in every authtype framework, since having two 1xx headings in an authority record is both invalid and not going to work, and you have to go to a lot of trouble to make the one that should be mandatory for that authtype not mandatory to have the 147 even pretend to do something. But since 147 and 162 exist, but are too obscure to be worth shipping an authtype framework for them, this seems like a reasonable solution if people do the wrong thing trying to use them. The patch doesn't work, though, since some stray whitespace crept into "->as _string." Should this be Needs Signoff? No, since "The patch doesn't work, though, since some stray whitespace crept into "->as _string."" |