Bug 1262571 - Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/lib64/perl5/vendor_perl/Amanda/Report/human.pm line 1203.
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /u...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: amanda (Show other bugs)
23
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Petr Hracek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-12 19:12 EDT by Trever Adams
Modified: 2016-02-09 04:39 EST (History)
7 users (show)

See Also:
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 04:39:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Trever Adams 2015-09-12 19:12:37 EDT
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 10:50:28 EST
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-19 19:25:18 EST
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-19 19:41:02 EST
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 17:34:52 EST
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 15:33:42 EST
amanda-3.3.8 use the following line:
  my $to_report = !defined $tries || !@$tries;
Comment 6 Joshua Baker-LePain 2016-02-04 14:00:13 EST
(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 04:39:13 EST
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.

Note You need to log in before you can comment on or make changes to this bug.