Bug 1262571

Summary: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm line 1203.
Product: [Fedora] Fedora Reporter: Trever Adams <trever>
Component: amandaAssignee: Petr Hracek <phracek>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 23CC: fedora, goodyca48, joshua.bakerlepain, martineau.jl, pb, phracek, uwe.menges
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: amanda-3.3.8-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-09 09:39:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Trever Adams 2015-09-12 23:12:37 UTC
Description of problem:
This is correct. Simply remove the defined and it works.

Version-Release number of selected component (if applicable):
amanda-3.3.7p1-1.fc23.x86_64
amanda-client-3.3.7p1-1.fc23.x86_64
amanda-libs-3.3.7p1-1.fc23.x86_64
amanda-server-3.3.7p1-1.fc23.x86_64

This bug is due to changes in perl. This bug may also apply to 23. I do not know at this time.

Comment 1 Peter Bieringer 2015-11-14 15:50:28 UTC
F23 has currently same bug and results in an empty report after amdump with active option "mailto".

Mail contents is mostly empty:

User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
From: amandabackup@...

=


Test:

/usr/sbin/amreport <HOST>
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm line 1203.
Compilation failed in require at (eval 13) line 1.
BEGIN failed--compilation aborted at (eval 13) line 1.


Proposed diff works:

# diff -u /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm.orig /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm
--- /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm.orig	2015-06-22 12:17:34.000000000 +0200
+++ /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm	2015-11-14 16:45:12.800335903 +0100
@@ -1200,7 +1200,7 @@
 
 	# Do not report driver error if we have a try with dumper
 	my $tries = $alldumps->{$report->{'run_timestamp'}};
-	my $to_report = !defined @$tries;
+	my $to_report = ! @$tries;
 	foreach my $try ( @$tries ) {
 	    $to_report = 1 if !defined $try->{'dumper'};
 	}


Please fix current broken versions

amanda-server-3.3.7p1-1.fc23.x86_64
amanda-3.3.7p1-1.fc23.x86_64
amanda-client-3.3.7p1-1.fc23.x86_64
amanda-libs-3.3.7p1-1.fc23.x86_64

Comment 2 Uwe Menges 2015-12-20 00:25:18 UTC
After applying this patch, it creates a report, but finally states:

amreport: Can't use an undefined value as an ARRAY reference at /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm line 1203.

Comment 3 Uwe Menges 2015-12-20 00:41:02 UTC
I don't know if it's related, but the initial email report sent from amdump was empty, and I had trouble to get the report emailed again. It seems the amreport is empty as soon as the output goes to a pipe.
I finally copy&pasted it with tmux from the terminal to a temporary file and emailed that.

Comment 4 Uwe Menges 2016-01-12 22:34:52 UTC
I think I have a better patch.

--- /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm.orig    2015-06-22 12:17:34.000000000 +0200
+++ /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm 2016-01-12 23:33:26.802368248 +0100
@@ -1200,7 +1200,7 @@ sub get_summary_info
 
        # Do not report driver error if we have a try with dumper
        my $tries = $alldumps->{$report->{'run_timestamp'}};
-       my $to_report = !defined @$tries;
+       my $to_report;
        foreach my $try ( @$tries ) {
            $to_report = 1 if !defined $try->{'dumper'};
        }

Comment 5 Jean-Louis Martineau 2016-01-27 20:33:42 UTC
amanda-3.3.8 use the following line:
  my $to_report = !defined $tries || !@$tries;

Comment 6 Joshua Baker-LePain 2016-02-04 19:00:13 UTC
(In reply to Jean-Louis Martineau from comment #5)
> amanda-3.3.8 use the following line:
>   my $to_report = !defined $tries || !@$tries;

This change made things work for me.  Thanks!

Comment 7 Petr Hracek 2016-02-09 09:39:13 UTC
This issue should be fixed by commit http://pkgs.fedoraproject.org/cgit/rpms/amanda.git/commit/?h=f23&id=c6e090ceb846020b43893aaac1779faf3551a60e

I have included amanda-3.3.8 in rawhide and F23.