Bug 1294761 - smbclient stderr output (e.g. tar:316 tarmode is now full, ...) is mistaken for failure
Summary: smbclient stderr output (e.g. tar:316 tarmode is now full, ...) is mistaken ...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: BackupPC
Version: 23
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Benjamin Lefoul
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-30 07:24 UTC by Ross Tyler
Modified: 2016-12-20 17:28 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 17:28:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch to fix backup problem (incompatibility with smbclient) (1.38 KB, patch)
2016-01-03 23:38 UTC, Ross Tyler
no flags Details | Diff
patch to additionally fix the backup problem with samba >= 4.1.6 (1.98 KB, patch)
2016-08-22 07:37 UTC, asmpro
no flags Details | Diff

Description Ross Tyler 2015-12-30 07:24:14 UTC
Description of problem:


BackupPC (BackupPC-3.3.1-2.fc23) PCs using the smb XferMethod will mistake new/latest (samba-client-4.3.3-0.fc23) smbclient stderr output for an error.
For example ...

tar:316 tarmode is now full, system, hidden, noreset, quiet 

... causes a backup or restore operation to report failure.

How reproducible:

Always.

Steps to Reproduce:
1. Configure a BackupPC PC using smb XferMethod
2. Create full backup

Actual results:

Taken from Xfer Error Summary of job ...

Running: /usr/bin/smbclient \\\\PC\\C\$ -U Administrator -E -d 1 -c tarmode\ full -Tc - Users/Administrator/Desktop Users/Administrator/Documents
full backup started for share C$
Xfer PIDs are now 5612,5611
[ skipped 1 lines ]
tar:316  tarmode is now full, system, hidden, noreset, quiet
tarExtract: 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.
tarExtract: 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.
[ skipped 21595 lines ]
tar:712  Total bytes received: 48765570236
[ skipped 85 lines ]
tarExtract: Done: 0 errors, 7068 filesExist, 47679457141 sizeExist, 42504775284 sizeExistComp, 7186 filesTotal, 48765597912 sizeTotal
Got fatal error during xfer (No files dumped for share C$)
Backup aborted (No files dumped for share C$)
Saving this as a partial backup, replacing the prior one (got 7186 and 0 files versus 0)


Expected results:

Same, but interpreted as a "full" backup "success" rather than a "partial", "failed" backup.


Additional info:

Similar results when restoring a file

Comment 1 Ross Tyler 2016-01-03 23:38:36 UTC
Created attachment 1111264 [details]
patch to fix backup problem (incompatibility with smbclient)

Comment 2 Ross Tyler 2016-01-03 23:39:33 UTC
Find smbclient.patch attached.

This (partially) addresses this issue as well as
https://bugzilla.redhat.com/show_bug.cgi?id=1259481

The patch fixes the interpretation of successful smbclient output:
As, apparently, a "tar: dumped \d+ files" message is no longer output (which was interpreted as success), the new "tar:\d+ Total bytes received: \d+" message is (additionally).
Other new "tar:\d+" messages are ignored.

Successful restores are still reported as failures.
Apparently, for lack of a "tar: restored \d+ files" message.
I am not sure how to fix this but it is not as critical as restorations will succeed (only to be reported as errors).

Comment 3 Ross Tyler 2016-04-09 20:58:20 UTC
Add
$Conf{BackupZeroFilesIsFatal} = 0;
to global or host config as smbclient output no longer provides indication of each file transfer so zero files are counted.

Comment 4 Ross Tyler 2016-04-09 21:44:05 UTC
"Direct Restore" option will reportedly fail because smbclient no longer provides indication of total file transfer.
Use "Download Zip archive" or "Download Tar archive" options instead, explode the downloaded archive manually and judge success for yourself.

Comment 5 chris ruettimann 2016-06-16 12:33:16 UTC
Hi, thanks for helping, backuppc is great software and I really like it!

I ran ito this problem by upgrading my hosts, so it stoped backing up my windows hosts.

Since backuppc only uses smbclient and nmblookup, I decided to downgrade until a proper fix is provided.

Sadly I not that good in perl to help fixing it.

But here are my notes to downgrade samba on centos7:

rpm -qa | grep samba | xargs rpm -e --nodeps
rpm -e --nodeps libsmbclient libwbclient

[root@backup x86_64]# ls -1
libsmbclient-4.1.1-10031.el7.centos.x86_64.rpm
libwbclient-4.1.1-10031.el7.centos.x86_64.rpm
samba-4.1.1-10031.el7.centos.x86_64.rpm
samba-client-4.1.1-10031.el7.centos.x86_64.rpm
samba-common-4.1.1-10031.el7.centos.x86_64.rpm
samba-dc-4.1.1-10031.el7.centos.x86_64.rpm
samba-dc-libs-4.1.1-10031.el7.centos.x86_64.rpm
samba-libs-4.1.1-10031.el7.centos.x86_64.rpm
samba-pidl-4.1.1-10031.el7.centos.x86_64.rpm
samba-python-4.1.1-10031.el7.centos.x86_64.rpm
samba-test-4.1.1-10031.el7.centos.x86_64.rpm
samba-vfs-glusterfs-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-clients-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-krb5-locator-4.1.1-10031.el7.centos.x86_64.rpm
samba-winbind-modules-4.1.1-10031.el7.centos.x86_64.rpm

yum install *.rpm

yum -y install yum-versionlock
yum versionlock add samba\* BackupPC

vi /etc/yum.conf
------
[main]
...
exclude=*samba* libsmb* libwbclient* BackupPC
------

yum makecache
yum upgrade # should not report depencies errors


I hope this will help others!

best regards

chris

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

Comment 7 asmpro 2016-08-22 07:35:44 UTC
Hi everybody!

Patch from Ross Tyler actually fixes the problem, but only partially. Number of successfully backed up files is still not retrieved on newer versions of samba (>= 4.1.6). I have created the patch to address the issue. The patch overwrites the variable holding the number of files backed up with the value retrieved from tar extract subroutine. I have only tested this, when in backup mode and have not tested what happens in restore mode.
Patch is attached alongside the Ross's patch.


Regards,
Uros Juvan

Comment 8 asmpro 2016-08-22 07:37:24 UTC
Created attachment 1192784 [details]
patch to additionally fix the backup problem with samba >= 4.1.6

Make sure number of backed up files is retrieved even in newer versions of samba (>= 4.1.6).

Comment 9 Fedora End Of Life 2016-11-24 14:35:25 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Fedora End Of Life 2016-12-20 17:28:40 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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