Carlos Gardel
2021-Mar-18 19:27 UTC
[Samba] samba 4.9.7 - DC online backup error - "uncaught exception - 'TarFile' object has no attribute '__exit__'"
Hi, I've been running two DC:s (DC1 and DC2) in a pure samba AD domain since 2015 on Centos 6. Starting with version 4.1.14 I have upgraded my way to version 4.9.7. It seems I have now reached the limit for possible upgrades of these DC:s since it is no longer possible to upgrade to 4.10 on Centos 6. I'm now preparing to deploy a DC3 on a Centos 8 vm with samba 4.14.0. Before joining it to the domain I have tried to make an online backup of the AD on the two existing DC:s following the guide at https://wiki.samba.org/index.php/Back_up_and_Restoring_a_Samba_AD_DC. When I run the command (as root) "samba-tool domain backup online --targetdir=/root/samba-backup/ --server=DC2 -UAdministrator" I get the following error: ERROR(<type 'exceptions.AttributeError'>): uncaught exception - 'TarFile' object has no attribute '__exit__' File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 178, in _run return self.run(*args, **kwargs) File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/domain_backup.py", line 243, in run backup_online(smb_conn, sysvol_tar, remote_sam.get_domain_sid()) File "/usr/local/samba/lib64/python2.6/site-packages/samba/ntacls.py", line 502, in backup_online with tarfile.open(name=dest_tarfile_path, mode='w:gz') as tar: [root at dc2 samba-backup]# Does anybody know if this can be fixed? It looks like the problem is python 2.6? I would be very grateful for all the help I can get since it would feel fantastic to be able to perform a backup before I start to join new DC:s and make changes to the existing setup. Best regards, Carlos
Rowland penny
2021-Mar-19 12:07 UTC
[Samba] samba 4.9.7 - DC online backup error - "uncaught exception - 'TarFile' object has no attribute '__exit__'"
On 18/03/2021 19:27, Carlos Gardel via samba wrote:> Hi, > > I've been running two DC:s (DC1 and DC2) in a pure samba AD domain since 2015 on Centos 6. Starting with version 4.1.14 I have upgraded my way to version 4.9.7. It seems I have now reached the limit for possible upgrades of these DC:s since it is no longer possible to upgrade to 4.10 on Centos 6. > > I'm now preparing to deploy a DC3 on a Centos 8 vm with samba 4.14.0. Before joining it to the domain I have tried to make an online backup of the AD on the two existing DC:s following the guide at https://wiki.samba.org/index.php/Back_up_and_Restoring_a_Samba_AD_DC. > > When I run the command (as root) "samba-tool domain backup online --targetdir=/root/samba-backup/ --server=DC2 -UAdministrator" I get the following error: > > ERROR(<type 'exceptions.AttributeError'>): uncaught exception - 'TarFile' object has no attribute '__exit__' > File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/__init__.py", line 178, in _run > return self.run(*args, **kwargs) > File "/usr/local/samba/lib64/python2.6/site-packages/samba/netcmd/domain_backup.py", line 243, in run > backup_online(smb_conn, sysvol_tar, remote_sam.get_domain_sid()) > File "/usr/local/samba/lib64/python2.6/site-packages/samba/ntacls.py", line 502, in backup_online > with tarfile.open(name=dest_tarfile_path, mode='w:gz') as tar: > [root at dc2 samba-backup]# > > Does anybody know if this can be fixed? It looks like the problem is python 2.6? > > I would be very grateful for all the help I can get since it would feel fantastic to be able to perform a backup before I start to join new DC:s and make changes to the existing setup. > > Best regards, > Carlos >You need python 2.7 at least, not being a Centos user, is it possible to upgrade Python ? Rowland
Andrew Bartlett
2021-Mar-19 18:12 UTC
[Samba] samba 4.9.7 - DC online backup error - "uncaught exception - 'TarFile' object has no attribute '__exit__'"
On Thu, 2021-03-18 at 19:27 +0000, Carlos Gardel via samba wrote:> Hi, > > I've been running two DC:s (DC1 and DC2) in a pure samba AD domain > since 2015 on Centos 6. Starting with version 4.1.14 I have upgraded > my way to version 4.9.7. It seems I have now reached the limit for > possible upgrades of these DC:s since it is no longer possible to > upgrade to 4.10 on Centos 6. > > I'm now preparing to deploy a DC3 on a Centos 8 vm with samba 4.14.0. > Before joining it to the domain I have tried to make an online backup > of the AD on the two existing DC:s following the guide at > https://wiki.samba.org/index.php/Back_up_and_Restoring_a_Samba_AD_DC. > > When I run the command (as root) "samba-tool domain backup online -- > targetdir=/root/samba-backup/ --server=DC2 -UAdministrator" I get the > following error:> I would be very grateful for all the help I can get since it would > feel fantastic to be able to perform a backup before I start to join > new DC:s and make changes to the existing setup.The backup is taken over the network, so just start he backup on a new modern Samba version, rather than with the old one. Python 2.6 was poorly tested with Samba - every release we would have a bug filed about some issue or other - which is one of the reasons we raised the minimum version recently to 3.5 and 3.6 - it was becoming foolish to pretend to support versions that we didn't run CI on. Andrew Bartlett> Best regards, > Carlos >-- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba Samba Development and Support, Catalyst IT - Expert Open Source Solutions