backuppc/smb: BackupPC failes to backup SMB shares after smbclient update
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
backuppc |
Fix Released
|
Unknown
|
|||
backuppc (Debian) |
Fix Released
|
Unknown
|
|||
backuppc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Xenial |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
An update to samba changed the behavior of smbclient and this broke backuppc's parsing of that output, causing smb backup jobs to fail.
[Test Case]
We will want to test four scenarios:
a) old samba, old backuppc: should work
b) old samba, new backuppc: should work
c) new samba, new backuppc: should work
d) new samba, old backuppc: should fail (this bug)
I suggest to proceed in the order listed above, as it's easier to downgrade backuppc (just one package) than to downgrade the whole samba suite. Alternatively, a new VM/LXD could be used for each scenario, of course.
The steps below are generic.
* Install samba and backuppc, and accept all defaults. Keep in mind which scenario from above you are testing, and adjust /etc/apt/
sudo apt update
sudo apt install samba backuppc
* If you want to use the web interface, take note of the password given during the installation and restart apache2 at the end:
sudo service apache2 restart
* If you want to regenerate the password, install apache2-utils and run the htpasswd command:
sudo apt install apache2-utils
sudo htpasswd /etc/backuppc/
* Add this snippet to the end of /etc/samba/
[public]
path = /public
guest ok = yes
read only = no
* Create /c and copy some content into it:
sudo mkdir /public
sudo chmod 1777 /public
sudo cp -a /usr/bin/x* /public
* restart the samba services
sudo service smbd restart; sudo service nmbd restart
* overwrite /etc/backuppc/
$Conf{XferMethod} = 'smb';
$Conf{XferLogLevel} = 1;
$Conf{ClientCha
$Conf{ClientCha
$Conf{SmbShareName} = 'public';
$Conf{SmbShareU
$Conf{SmbShareP
* Now you are ready to run the backup command. Depending on the scenario being tested, it will work or fail.
This is the working scenario:
$ sudo -u backuppc -H /usr/share/
started full dump, share=C$
xferPids 7009,7008
full backup complete
$ echo $?
0
This is the failing scenario:
$ sudo -u backuppc -H /usr/share/
started full dump, share=C$
xferPids 11008,11007
dump failed: No files dumped for share C$
link localhost
$ echo $?
2
[Regression Potential]
Since there is a tight coupling between samba and backuppc, there could be a regression for people who are not using the latest versions of each package. Therefore, I added specific tests for that to this SRU: all combinations of old and new packages of both samba and backuppc. Prior to uploading, I performed these tests myself and all combinations work as expected, with the only failing one being this bug that is being fixed.
That being said, there is no guarantee that future samba or backuppc updates won't break again, because of this tight coupling. This package could benefit from DEP8 tests in that area.
[Other Info]
The fix adopted in Debian and Ubuntu Bionic onwards is different than the one presented here. The one used here is what was merged upstream, and doesn't require a configuration file change. I chose to leave bionic alone for now, since the bug is fixed there, just differently.
[Original Description]
After the current update of samba 4.1.6 to 4.3.8 samba on trusty the BackupPC smb transfer is broken.
Several bugs in smbclient >= 4.1.6 in combination with BackupPC:
https:/
- patch1 (reenable tarmode verbose, and skip inaccessible files) https:/
- patch 2 (modified clitar.c for tarmode verbose) https:/
https:/
Package Information:
0)root@essrv2:~ $ dpkg -l | grep -E "(smb|samba|
ii backuppc 3.3.0-1ubuntu1 amd64 high-performance, enterprise-grade system for backing up PCs
ii libpam-
ii libsmbclient:amd64 2:4.3.8+
ii python-samba 2:4.3.8+
ii samba 2:4.3.8+
ii samba-common 2:4.3.8+
ii samba-common-bin 2:4.3.8+
ii samba-doc 2:4.3.8+
ii samba-dsdb-modules 2:4.3.8+
ii samba-libs:amd64 2:4.3.8+
ii samba-vfs-modules 2:4.3.8+
ii smbclient 2:4.3.8+
System information of the update:
0)root@essrv2:~ $ grep samba /var/log/
Upgrade: libpam-
python-
samba:amd64 (4.1.6+
samba-
samba-
samba-libs:amd64 (4.1.6+
samba-doc:amd64 (4.1.6+
smbclient:amd64 (4.1.6+
samba-
samba-
libsmbclient:
Log of backup when failing:
Running: /usr/bin/smbclient \\\\esrouter\
full backup started for share backups
Xfer PIDs are now 25749,25748
Domain=[E_SPIRIT] OS=[Windows 6.1] Server=[Samba 4.3.8-Ubuntu]
tar:316 tarmode is now full, system, hidden, noreset, quiet
tar:712 Total bytes received: 224900956
create 644 0/0 138326 esrouter.
pool 644 0/0 136349 esrouter.
pool 644 0/0 27551 esrouter.
create 644 0/0 56037724 esrouter.
create 644 0/0 56017156 esrouter.
create 644 0/0 27964 esrouter.
pool 644 0/0 136349 esrouter.
create 644 0/0 138326 esrouter.
create 644 0/0 27964 esrouter.
pool 644 0/0 27551 esrouter.
create 644 0/0 56090628 esrouter.
create 644 0/0 56095068 esrouter.
tarExtract: Done: 0 errors, 4 filesExist, 327800 sizeExist, 77902 sizeExistComp, 12 filesTotal, 224900956 sizeTotal
Got fatal error during xfer (No files dumped for share backups)
Backup aborted (No files dumped for share backups)
Saving this as a partial backup, replacing the prior one (got 12 and 0 files versus 0)
Running: /usr/bin/smbclient \\\\esrouter\
full backup started for share backups
Xfer PIDs are now 23275,23274
Domain=[E_SPIRIT] OS=[Windows 6.1] Server=[Samba 4.3.8-Ubuntu]
tar:316 tarmode is now full, system, hidden, noreset, verbose
tar:712 Total bytes received: 225006494
create 644 0/0 56140872 esrouter.
pool 644 0/0 138326 esrouter.
pool 644 0/0 56017156 esrouter.
pool 644 0/0 138326 esrouter.
pool 644 0/0 27964 esrouter.
pool 644 0/0 27964 esrouter.
pool 644 0/0 136349 esrouter.
pool 644 0/0 138326 esrouter.
pool 644 0/0 27964 esrouter.
pool 644 0/0 27551 esrouter.
pool 644 0/0 56090628 esrouter.
pool 644 0/0 56095068 esrouter.
tarExtract: Done: 0 errors, 11 filesExist, 168865622 sizeExist, 168378417 sizeExistComp, 12 filesTotal, 225006494 sizeTotal
Got fatal error during xfer (No files dumped for share backups)
Backup aborted (No files dumped for share backups)
Not saving this as a partial backup since it has fewer files than the prior one (got 12 and 0 files versus 12)
Log of working backup:
Running: /usr/bin/smbclient \\\\esrouter\
full backup started for share backups
Xfer PIDs are now 20343,20342
tar_re_search set
Domain=[E_SPIRIT] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
tarmode is now full, system, hidden, noreset, verbose
tar: dumped 12 files and directories
Total bytes written: 223928320
pool 644 0/0 55839072 esrouter.
pool 644 0/0 124612 esrouter.
pool 644 0/0 124612 esrouter.
pool 644 0/0 25011 esrouter.
pool 644 0/0 25011 esrouter.
pool 644 0/0 55829392 esrouter.
pool 644 0/0 25011 esrouter.
pool 644 0/0 124612 esrouter.
pool 644 0/0 124612 esrouter.
pool 644 0/0 25011 esrouter.
pool 644 0/0 55820624 esrouter.
create 644 0/0 55838452 esrouter.
tarExtract: Done: 0 errors, 11 filesExist, 168087580 sizeExist, 167649233 sizeExistComp, 12 filesTotal, 223926032 sizeTotal
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
- Canonical Server Core Reviewers: Pending requested
-
Diff: 204 lines (+167/-0)5 files modifieddebian/changelog (+8/-0)
debian/patches/smb-compat-fix.patch (+66/-0)
debian/rules (+1/-0)
debian/tests/control (+3/-0)
debian/tests/smb-backup (+89/-0)
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
- Canonical Server Core Reviewers: Pending requested
-
Diff: 204 lines (+167/-0)5 files modifieddebian/changelog (+8/-0)
debian/patches/smb-compat-fix.patch (+66/-0)
debian/rules (+1/-0)
debian/tests/control (+3/-0)
debian/tests/smb-backup (+89/-0)
description: | updated |
Changed in backuppc (Ubuntu): | |
status: | Confirmed → Triaged |
tags: | added: server-next |
description: | updated |
description: | updated |
Changed in backuppc (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in backuppc (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in backuppc (Ubuntu Trusty): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
Changed in backuppc (Ubuntu Xenial): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: removal-candidate |
Changed in backuppc (Debian): | |
status: | Unknown → Fix Released |
Changed in backuppc: | |
status: | Unknown → Fix Released |
I'm seeing similar behaviour in Debian (Jessie) with smbclient 4.3.8 and backuppc
I had a perfectly working backup system before the upgrade.
Just mentioning that here in case it helps anybody else.