Bug 1259481

Summary: BackupPC Lib.pm Browse.pm fail - using tar method
Product: [Fedora] Fedora Reporter: Ronald L Humble <deadletterfile>
Component: BackupPCAssignee: Benjamin Lefoul <lef>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: bjohnson, equistango, kennethohman1, rocketraman, sixerjman, stephen.dum
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: BackupPC-3.3.1-5.fc24 BackupPC-3.3.1-5.fc23 BackupPC-3.3.1-5.el5 BackupPC-3.3.1-5.el6 BackupPC-3.3.1-5.el7 BackupPC-3.3.1-7.fc25 BackupPC-3.3.1-7.fc24 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-19 05:54: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:
Attachments:
Description Flags
Patch to strip out 'defined(@array)' type statements none

Description Ronald L Humble 2015-09-02 17:13:50 UTC
Description of problem:
BackupPC will neither backup nor restore (manual or web interface)
config.pl -> $Conf{TarClientPath} = '/usr/bin/gtar';
config.pl -> $Conf{XferMethod} = "tar";

Version-Release number of selected component (if applicable):
BackupPC-3.3.1-2.fc23.x86_64

How reproducible:
Attempt backup full or incr from web interface. Monitor of log file shows a quick failure.

Steps to Reproduce:
1. See above
2.
3.

Actual results:
Backup or restore via web interface (and likely manually as well) quickly fail.

Expected results:
BackupPC backs up and restores files (as in Fedora 22 and prior)

Additional info:
From BackupPC logs:
2015-09-01 22:03:11 User backuppc requested backup of rumble (rumble)
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE (\w+)}(\+?)/ at /usr/share/BackupPC/lib/BackupPC/Lib.pm line 1268.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(.*)\${ <-- HERE (\w+)}(\+?)(.*)/ at /usr/share/BackupPC/lib/BackupPC/Lib.pm line 1274.

Suggested fix was trivial and allowed backups to be made as expected:
vim +1268 /usr/share/BackupPC/lib/BackupPC/Lib.pm
This is the suggested fix:
        $arg =~ s[\$\{(\w+)}(\+?)]{
            exists($vars->{$1}) && ref($vars->{$1}) ne "ARRAY"
                ? ($2 eq "+" ? $bpc->shellEscape($vars->{$1}) : $vars->{$1})
                : "\${$1}$2"
        }eg;
        #
        # Now replicate any array arguments; this just works for just one
        # array var in each argument.
        #
        # orig -> if ( $arg =~ m[(.*)\${(\w+)}(\+?)(.*)] && ref($vars->{$2}) eq "ARRAY" ) {
                  if ( $arg =~ m[(.*)\$\{(\w+)}(\+?)(.*)] && ref($vars->{$2}) eq "ARRAY" ) {

#2:
An attempt to view/restore files from a backup via web interface fails with web page displaying:
Software error:

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/share/BackupPC/lib/BackupPC/CGI/Browse.pm line 68.

For help, please send mail to the webmaster
Software error:

[Tue Sep  1 22:28:27 2015] BackupPC_Admin.pl: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/share/BackupPC/lib/BackupPC/CGI/Browse.pm line 68.
Compilation failed in require at /usr/share/BackupPC/sbin/BackupPC_Admin.pl line 108.

This is beyond my time and attention span at this time. I am happy with successful backups at this time. Would method rsync work? My guess is not, as Perl code is likely used by all methods.

Comment 1 Dominique Brazziel 2015-11-23 18:12:30 UTC
I just ran into this bug this morning.  Wondering where/what the root cause, i.e. a Perl package upgrade?  A couple of backups ran yesterday, one rsync backup at 15:00, and localhost (gtar) at 18:00.  No package changes for BackupPC
(Version 3.3.1), no perl-* packages upgraded since 11/19.

Comment 2 Dominique Brazziel 2015-12-09 18:21:24 UTC
It looks like Perl 5.22 deprecated 'defined(@array)' per:

http://perldoc.perl.org/functions/defined.html

I guess it's usage threw a warning before but it has since been hardened to an error.  I found a few reports of other Perl based package(s) discussing this problem:

https://github.com/kentcdodds/cloc/issues/1
http://sourceforge.net/p/cloc/bugs/135/
https://bugs.archlinux.org/task/45494

I think the fix for this might be only a few lines, working on patch now.

Comment 3 Dominique Brazziel 2015-12-09 18:39:02 UTC
Created attachment 1104083 [details]
Patch to strip out 'defined(@array)' type statements

Comment 4 Dominique Brazziel 2015-12-09 18:42:41 UTC
The attached patch fixes the 'defined(@array)' error and I am once again able to 
browse backups on the web.(In reply to Dominique Brazziel from comment #2)
> It looks like Perl 5.22 deprecated 'defined(@array)' per:
> 
> http://perldoc.perl.org/functions/defined.html
> 
> I guess it's usage threw a warning before but it has since been hardened to
> an error.  I found a few reports of other Perl based package(s) discussing
> this problem:
> 
> https://rt.cpan.org/Public/Bug/Display.html?id=102732
> https://github.com/kentcdodds/cloc/issues/1
> http://sourceforge.net/p/cloc/bugs/135/
> https://bugs.archlinux.org/task/45494
> 
> I think the fix for this might be only a few lines, working on patch now.

Comment 5 Dominique Brazziel 2015-12-09 18:44:35 UTC
Further root cause info at:  

https://rt.cpan.org/Public/Bug/Display.html?id=102732

Comment 6 Fedora Admin XMLRPC Client 2016-06-28 16:31:51 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Dominique Brazziel 2016-07-14 14:28:53 UTC
This error raised it's ugly head again after a system upgrade from Release 23 to 24:

Jul 13 06:05:02 DEBUG ---> Package BackupPC.x86_64 3.3.1-2.fc23 will be upgraded
Jul 13 06:05:02 DEBUG ---> Package BackupPC.x86_64 3.3.1-3.fc24 will be an upgrade

Comment 8 Dominique Brazziel 2016-07-14 14:31:04 UTC
Here is one of the attendant Perl upgrades:

Jul 13 06:05:02 DEBUG ---> Package perl-libs.x86_64 4:5.22.2-352.fc23 will be upgraded
Jul 13 06:05:02 DEBUG ---> Package perl-libs.x86_64 4:5.22.2-360.fc24 will be an upgrade

Comment 9 Benjamin Lefoul 2016-07-14 15:06:38 UTC
Someone submitted a pull request upstream that looks like your patch. Is it sufficient: https://github.com/backuppc/backuppc/pull/6

Comment 10 Benjamin Lefoul 2016-07-15 07:35:50 UTC
(In reply to Dominique Brazziel from comment #8)
> Here is one of the attendant Perl upgrades:
> 
> Jul 13 06:05:02 DEBUG ---> Package perl-libs.x86_64 4:5.22.2-352.fc23 will
> be upgraded
> Jul 13 06:05:02 DEBUG ---> Package perl-libs.x86_64 4:5.22.2-360.fc24 will
> be an upgrade

Dominique, as far as I can tell, only this line is required to patch. You also changed the defined($blah) in your patch. If you agree I can push the patch today.

Comment 11 Benjamin Lefoul 2016-07-15 07:36:28 UTC
(In reply to Benjamin Lefoul from comment #10)
> (In reply to Dominique Brazziel from comment #8)
> > Here is one of the attendant Perl upgrades:
> > 
> > Jul 13 06:05:02 DEBUG ---> Package perl-libs.x86_64 4:5.22.2-352.fc23 will
> > be upgraded
> > Jul 13 06:05:02 DEBUG ---> Package perl-libs.x86_64 4:5.22.2-360.fc24 will
> > be an upgrade
> 
> Dominique, as far as I can tell, only this line is required to patch. You
> also changed the defined($blah) in your patch. If you agree I can push the
> patch today.

https://github.com/backuppc/backuppc/pull/6/files

Comment 12 Fedora Update System 2016-07-15 09:25:53 UTC
BackupPC-3.3.1-5.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-79aff83834

Comment 13 Fedora Update System 2016-07-15 09:42:57 UTC
BackupPC-3.3.1-5.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ad37696d55

Comment 14 Fedora Update System 2016-07-15 09:59:44 UTC
BackupPC-3.3.1-5.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-acc040175d

Comment 15 Fedora Update System 2016-07-15 19:25:12 UTC
BackupPC-3.3.1-5.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-79aff83834

Comment 16 Fedora Update System 2016-07-16 01:23:35 UTC
BackupPC-3.3.1-5.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-acc040175d

Comment 17 Fedora Update System 2016-07-16 15:22:38 UTC
BackupPC-3.3.1-5.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ad37696d55

Comment 18 Benjamin Lefoul 2016-07-20 05:18:25 UTC
*** Bug 1290964 has been marked as a duplicate of this bug. ***

Comment 19 Fedora Update System 2016-07-20 06:14:14 UTC
BackupPC-3.3.1-5.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-2abb037ba5

Comment 20 Fedora Update System 2016-07-20 06:21:51 UTC
BackupPC-3.3.1-5.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-7a365bf7d0

Comment 21 Fedora Update System 2016-07-20 06:26:11 UTC
BackupPC-3.3.1-5.el5 has been submitted as an update to Fedora EPEL 5. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-e962946cc3

Comment 22 Fedora Update System 2016-07-20 18:15:38 UTC
BackupPC-3.3.1-5.el5 has been pushed to the Fedora EPEL 5 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-e962946cc3

Comment 23 Fedora Update System 2016-07-20 18:18:12 UTC
BackupPC-3.3.1-5.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-7a365bf7d0

Comment 24 Fedora Update System 2016-07-20 18:19:55 UTC
BackupPC-3.3.1-5.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-2abb037ba5

Comment 25 Fedora Update System 2016-07-24 20:21:28 UTC
BackupPC-3.3.1-5.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2016-07-25 03:18:51 UTC
BackupPC-3.3.1-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 27 Fedora Update System 2016-08-04 14:48:44 UTC
BackupPC-3.3.1-5.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.

Comment 28 Fedora Update System 2016-08-04 23:18:24 UTC
BackupPC-3.3.1-5.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 29 Fedora Update System 2016-08-04 23:21:08 UTC
BackupPC-3.3.1-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Comment 30 Kenneth 2016-12-07 14:30:51 UTC
BackupPC-3.3.1-6.fc24.x86_64 Bugg still exists
From BackupPC logs:
2016-12-07
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE (\w+)}(\+?)/ at /usr/share/BackupPC/lib/BackupPC/Lib.pm line 1268.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(.*)\${ <-- HERE (\w+)}(\+?)(.*)/ at /usr/share/BackupPC/lib/BackupPC/Lib.pm line 1273.

Comment 31 Ernesto 2016-12-22 13:01:03 UTC
I can confirm this is present in Fedora 25 as of 2016-12-07. All my backups stopped working on that day.

$ rpm -qa | egrep "BackupPC|perl-libs"
BackupPC-3.3.1-6.fc25.x86_64
perl-libs-5.24.0-380.fc25.x86_64

Comment 32 Fedora Update System 2017-01-10 14:01:04 UTC
BackupPC-3.3.1-7.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-43835f9e0d

Comment 33 Fedora Update System 2017-01-10 14:13:07 UTC
BackupPC-3.3.1-7.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c9acf408f9

Comment 34 Fedora Update System 2017-01-11 03:21:44 UTC
BackupPC-3.3.1-7.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-43835f9e0d

Comment 35 Fedora Update System 2017-01-11 03:49:01 UTC
BackupPC-3.3.1-7.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c9acf408f9

Comment 36 Fedora Update System 2017-01-19 05:54:13 UTC
BackupPC-3.3.1-7.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 37 Fedora Update System 2017-01-19 06:20:27 UTC
BackupPC-3.3.1-7.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.