Bug 1294761 - smbclient stderr output (e.g. tar:316 tarmode is now full, ...) is mistaken for failure
smbclient stderr output (e.g. tar:316 tarmode is now full, ...) is mistaken ...
Product: Fedora
Classification: Fedora
Component: BackupPC (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Benjamin Lefoul
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-12-30 02:24 EST by Ross Tyler
Modified: 2016-12-20 12:28 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 12:28:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch to fix backup problem (incompatibility with smbclient) (1.38 KB, patch)
2016-01-03 18:38 EST, 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 03:37 EDT, asmpro
no flags Details | Diff

  None (edit)
Description Ross Tyler 2015-12-30 02:24:14 EST
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:


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 18:38 EST
Created attachment 1111264 [details]
patch to fix backup problem (incompatibility with smbclient)
Comment 2 Ross Tyler 2016-01-03 18:39:33 EST
Find smbclient.patch attached.

This (partially) addresses this issue as well as

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 16:58:20 EDT
$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 17:44:05 EDT
"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 08:33:16 EDT
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

yum install *.rpm

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

vi /etc/yum.conf
exclude=*samba* libsmb* libwbclient* BackupPC

yum makecache
yum upgrade # should not report depencies errors

I hope this will help others!

best regards

Comment 6 Fedora Admin XMLRPC Client 2016-06-28 12:31:54 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 asmpro 2016-08-22 03:35:44 EDT
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.

Uros Juvan
Comment 8 asmpro 2016-08-22 03:37 EDT
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 09:35:25 EST
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 12:28:40 EST
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

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.