Bug 1259481 - BackupPC Lib.pm Browse.pm fail - using tar method
BackupPC Lib.pm Browse.pm fail - using tar method
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: BackupPC (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Benjamin Lefoul
Fedora Extras Quality Assurance
: Reopened
: 1290964 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-02 13:13 EDT by Ronald L Humble
Modified: 2017-01-19 01:20 EST (History)
6 users (show)

See Also:
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 00:54: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)
Patch to strip out 'defined(@array)' type statements (1.85 KB, patch)
2015-12-09 13:39 EST, Dominique Brazziel
no flags Details | Diff

  None (edit)
Description Ronald L Humble 2015-09-02 13:13:50 EDT
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 13:12:30 EST
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 13:21:24 EST
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 13:39 EST
Created attachment 1104083 [details]
Patch to strip out 'defined(@array)' type statements
Comment 4 Dominique Brazziel 2015-12-09 13:42:41 EST
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 13:44:35 EST
Further root cause info at:  

https://rt.cpan.org/Public/Bug/Display.html?id=102732
Comment 6 Fedora Admin XMLRPC Client 2016-06-28 12:31:51 EDT
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 10:28:53 EDT
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 10:31:04 EDT
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 11:06:38 EDT
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 03:35:50 EDT
(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 03:36:28 EDT
(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 05:25:53 EDT
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 05:42:57 EDT
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 05:59:44 EDT
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 15:25:12 EDT
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-15 21:23:35 EDT
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 11:22:38 EDT
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 01:18:25 EDT
*** Bug 1290964 has been marked as a duplicate of this bug. ***
Comment 19 Fedora Update System 2016-07-20 02:14:14 EDT
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 02:21:51 EDT
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 02:26:11 EDT
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 14:15:38 EDT
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 14:18:12 EDT
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 14:19:55 EDT
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 16:21:28 EDT
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-24 23:18:51 EDT
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 10:48:44 EDT
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 19:18:24 EDT
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 19:21:08 EDT
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 09:30:51 EST
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 08:01:03 EST
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 09:01:04 EST
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 09:13:07 EST
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-10 22:21:44 EST
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-10 22:49:01 EST
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 00:54:13 EST
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 01:20:27 EST
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.

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