open-ils.storage fails to start with perl >= 5.24

Bug #1707549 reported by Graham Billiau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned

Bug Description

Platform: Gentoo Hardened
OpenSRF: Master
Evergreen: 2.12.4
PostgreSQL: 9.5.7
Perl: 5.24.1

The open-ils.storage OpenSRF module fails to start when using perl >= 5.24.

Logs report the following error:
[2017-07-31 10:28:57] OpenSRF Listener [open-ils.storage] [ERR :18779:Publisher.pm:405:] ARG! Couldn't load metabib class Publisher: Experimental keys on scalar is now forbidden at /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage/Publisher/metabib.pm line 3189.
[2017-07-31 10:28:57] OpenSRF Listener [open-ils.storage] [ERR :18779:EX.pm:66:] Exception: OpenSRF::EX::ERROR 2017-07-31T10:28:57 OpenILS::Application::Storage::Publisher /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage/Publisher.pm:406 System ERROR: ARG! Couldn't load metabib class Publisher: Experimental keys on scalar is now forbidden at /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage/Publisher/metabib.pm line 3189.
[2017-07-31 10:28:57] OpenSRF Listener [open-ils.storage] [ERR :18779:Storage.pm:47:] FAILURE LOADING Publisher! Exception: OpenSRF::EX::ERROR 2017-07-31T10:28:57 UNIVERSAL /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage.pm:45 System ERROR: ARG! Couldn't load metabib class Publisher: Experimental keys on scalar is now forbidden at /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage/Publisher/metabib.pm line 3189.
[2017-07-31 10:28:57] OpenSRF Listener [open-ils.storage] [ERR :18779:EX.pm:66:] Exception: OpenSRF::EX::PANIC 2017-07-31T10:28:57 OpenILS::Application::Storage /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage.pm:48 System PANIC: FAILURE LOADING Publisher! : Exception: OpenSRF::EX::ERROR 2017-07-31T10:28:57 UNIVERSAL /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage.pm:45 System ERROR: ARG! Couldn't load metabib class Publisher: Experimental keys on scalar is now forbidden at /usr/local/lib64/perl5/5.24.1/OpenILS/Application/Storage/Publisher/metabib.pm line 3189.

I found the following extra information with a quick search (though I couldn't find the original source):
"Experimental %s on scalar is now forbidden (F) An experimental feature added in Perl 5.14 allowed each, keys, push, pop, shift, splice, unshift, and values to be called with a scalar argument. This experiment is considered unsuccessful, and has been removed. The postderef feature may meet your needs better."

Tags: pullrequest
Revision history for this message
Mike Rylander (mrylander) wrote :

Ah, well, at least that's a simple one to fix:

--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
@@ -3186,7 +3186,7 @@ sub query_parser_fts_wrapper {
     $top_org ||= actor::org_unit->search( { parent_ou => undef } )->next;

     my $base_query = $args{query} || '';
- if (scalar(keys($args{searches}))) {
+ if (ref($args{searches}) && scalar(keys(%{$args{searches}}))) {
         $log->debug("Constructing QueryParser query from staged search hash ...", DEBUG);
         for my $sclass ( keys %{$args{searches}} ) {
             $log->debug(" --> staged search key: $sclass --> term: $args{searches}{$sclass}{term}", DEBUG);

Thanks, Graham!

I'll push a branch soon.

Changed in evergreen:
assignee: nobody → Mike Rylander (mrylander)
Revision history for this message
Mike Rylander (mrylander) wrote :
tags: added: pullrequest
Galen Charlton (gmc)
Changed in evergreen:
milestone: none → 2.12.5
status: New → Confirmed
importance: Undecided → High
assignee: Mike Rylander (mrylander) → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master and rel_2_12. Thanks, Graham and Mike!

(Despite an earlier series target I made, this didn't turn out to affect 2.11.x).

no longer affects: evergreen/2.11
Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Galen Charlton (gmc) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.