[Bug 35618] New: catalogue/showelastic.pl uses deprecated/removed parameter "type"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Bug ID: 35618 Summary: catalogue/showelastic.pl uses deprecated/removed parameter "type" Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: schodkowy.omegi-0r@icloud.com This can be treated as follow-up to Bug 33353. The showelastic.pl page still uses "type" parameter that was deprecated in ES7 and removed in ES8: https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types... Bug 33353's patch already removed it in other places: https://github.com/Koha-Community/Koha/commit/24aab6b9c52cb9846653d34d5630ca... But one place remained: https://github.com/Koha-Community/Koha/blob/d6314d32246a7e967e78f1427c338a3e... This yields the following output in log: ``` [WARN] [Param] ** Unknown param (type) in (get) request. , called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /usr/share/koha/intranet/cgi-bin/catalogue/showelastic.pl line 61. ``` An exception is caught and user is redirected to 404 error page for all requests. I will be created a patch for this in a moment, as I verified removing this field fixes the bug. -- 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=35618 M <schodkowy.omegi-0r@icloud.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |schodkowy.omegi-0r@icloud.c | |om Assignee|koha-bugs@lists.koha-commun |schodkowy.omegi-0r@icloud.c |ity.org |om Status|NEW |Needs Signoff --- Comment #1 from M <schodkowy.omegi-0r@icloud.com> --- Created attachment 160123 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160123&action=edit [PATCH] Bug 35618: Remove deprecated parameter "type" from showelastic.pl page This fixes the issue with ES8, should still work with ES7 as there types were just deprecated (and not fully removed yet). Won't work with ES6, but Koha master doesn't support it anymore already. Should be backported to 23.11, but not to 23.05 or earlier. To test, one should view a biblio record in staff interface and press "Show" next to "Elasticsearch Record:". With ES8 it will return 404 before applying this patch, check log in /var/log/koha/biblioteka/plack-intranet-error.log -- 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=35618 M <schodkowy.omegi-0r@icloud.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33353 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33353 [Bug 33353] Add compatibility with Elasticsearch 8 and OpenSearch 2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 160221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160221&action=edit Bug 35618: Remove deprecated parameter "type" from showelastic.pl page This is a follow-up to Bug 33353. Types are gone in ES8 and deprecated in ES7. Support for ES6 is already dropped in Koha master. The parameter has to be removed, otherwise an exception is thrown with ES8 (which is listed as officially supported by Koha now). Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Attachment #160123|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the display when release notes| |clicking on "Show" for the | |"Elasticsearch record" | |entry for a record in the | |staff interface. Before | |this fix, a page not found | |(404) was displayed when | |viewing a record using | |Elasticsearch 7 or 8, or | |Open Search 1 ord 2. (Note | |that Elasticsearch 6 is no | |longer supported.) --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using koha-testing-docker (KTD)): 1. Start up KTD with Elasticsearch 8 (ktd --es8 up) 2. In the staff interface, search and view a record. 3. For "Elasticsearch Record", click on the "Show" link. ==> Pop up window says "An error has occured Error 404..." ==> In /var/log/koha/kohadev/plack-intranet-error.log there is a warning: ES8: [2023/12/21 20:40:33] [WARN] [Request] ** [http://es:9200]-[400] no handler found for uri [/koha_kohadev_biblios/data/46] and method [GET], called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /kohadevbox/koha/catalogue/showelastic.pl line 61. With vars: {'request' => {'body' => undef,'method' => 'GET','serialize' => 'std','path' => '/koha_kohadev_biblios/data/46','ignore' => [],'qs' => {}},'body' => {'error' => 'no handler found for uri [/koha_kohadev_biblios/data/46] and method [GET]'},'status_code' => 400} ES7: [2023/12/21 21:05:31] [WARN] [Missing] ** [http://es:9200]-[404] Not Found, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /kohadevbox/koha/catalogue/showelastic.pl line 61. With vars: {'request' => {'ignore' => [],'qs' => {},'path' => '/koha_kohadev_biblios/data/32','method' => 'GET','serialize' => 'std','body' => undef},'status_code' => 404,'body' => {'_index' => 'koha_kohadev_biblios','_type' => 'data','found' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ),'_id' => '32'}} OS1: [2023/12/21 21:15:14] [WARN] [Missing] ** [http://es:9200]-[404] Not Found, called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /kohadevbox/koha/catalogue/showelastic.pl line 61. With vars: {'request' => {'ignore' => [],'path' => '/koha_kohadev_biblios/data/32','method' => 'GET','qs' => {},'serialize' => 'std','body' => undef},'status_code' => 404,'body' => {'_type' => 'data','_id' => '32','found' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ),'_index' => 'koha_kohadev_biblios'}} OS2: [2023/12/21 21:25:04] [WARN] [Request] ** [http://es:9200]-[400] no handler found for uri [/koha_kohadev_biblios/data/5] and method [GET], called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /kohadevbox/koha/catalogue/showelastic.pl line 61. With vars: {'body' => {'error' => 'no handler found for uri [/koha_kohadev_biblios/data/5] and method [GET]'},'status_code' => 400,'request' => {'body' => undef,'method' => 'GET','path' => '/koha_kohadev_biblios/data/5','qs' => {},'ignore' => [],'serialize' => 'std'}} 4. Apply the patch and restart_all. 5. Repeat steps 2-3: ==> The pop-up window should now show the Elasticsearch record and no warning in the log [1]. 6. Repeat using Elasticsearch 7 (ktd --es7 up), OpenSearch 1 (ktd --os1 up)and OpenSearch 2 (ktd --es7 up). [1] Note that there are two warnings in the log - these are generated when you view the record in the staff interface, so I'm assuming that these are unrelated to this bug: [2023/12/21 20:49:44] [WARN] DBIx::Class::ResultSetColumn::new(): Attempting to retrieve non-unique column 'biblionumber' on a resultset containing one-to-many joins will return duplicate results. at /kohadevbox/koha/Koha/Objects.pm line 426 [2023/12/21 20:49:44] [WARN] DBIx::Class::ResultSet::_construct_results(): Unable to properly collapse has_many results in iterator mode due to order criteria - performed an eager cursor slurp underneath. Consider using ->all() instead at /kohadevbox/koha/Koha/Objects.pm line 317 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 --- Comment #4 from M <schodkowy.omegi-0r@icloud.com> --- Yeah the other warnings are probably unrelated directly to this. Repeatedly opening the Elasticsearch record view only repeatedly generates the single warn about type param being invalid. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |julian.maurice@biblibre.com CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #160221|0 |1 is obsolete| | --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 160227 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=160227&action=edit Bug 35618: Remove deprecated parameter "type" from showelastic.pl page This is a follow-up to Bug 33353. Types are gone in ES8 and deprecated in ES7. Support for ES6 is already dropped in Koha master. The parameter has to be removed, otherwise an exception is thrown with ES8 (which is listed as officially supported by Koha now). Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |24.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.05.00 |24.05.00,23.11.02 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED CC| |lucas@bywatersolutions.com --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Missing 23.05.x dependencies. No backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18829 CC| |aleisha@catalyst.net.nz Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18829 [Bug 18829] Elasticsearch - Add ability to view the ES indexed record -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 --- Comment #9 from Danyon Sewell <danyonsewell@catalyst.net.nz> --- Created attachment 168306 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=168306&action=edit Bug 35618 - catalogue/showelastic.pl uses deprecated/removed parameter "type" [ES7.x] it appears despite "type" being depreciated it's still required in some cases. [2024/07/01 14:24:52] [WARN] [Param] ** Missing required param (type) in (get) request. , called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /usr/share/koha/intranet/cgi-bin/catalogue/showelastic.pl line 61. subbing it out with type '_doc' seems to do the trick -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #10 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- (In reply to Danyon Sewell from comment #9)
Created attachment 168306 [details] [review] Bug 35618 - catalogue/showelastic.pl uses deprecated/removed parameter "type" [ES7.x]
it appears despite "type" being depreciated it's still required in some cases.
[2024/07/01 14:24:52] [WARN] [Param] ** Missing required param (type) in (get) request. , called from sub Search::Elasticsearch::Role::Client::Direct::__ANON__ at /usr/share/koha/intranet/cgi-bin/catalogue/showelastic.pl line 61.
subbing it out with type '_doc' seems to do the trick
As far as I can tell this only works if Koha has not been reindexed and the 'type' / 'data' is stil defined in the indexes - in both ES7 and ES8 it breaks when I add "_doc" If this is still an issue can you file anew bug Danyon? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37494 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37494 [Bug 37494] catalogue/showelastic.pl missing parameter "type" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- I've opened Bug 37494 to propose your fix Danyon. Please go and test it ;) Works for me with ES 8. This report is closed so I hide your patch. I love this super-cool ES feature. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #168306|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35618 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38912 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org