Bug 13898 - samba-tool domain backup offline --targetdir=/home/samba-backup FAILS
samba-tool domain backup offline --targetdir=/home/samba-backup FAILS
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools
4.10.2
All Linux
: P5 normal
: ---
Assigned To: Tim Beale
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-15 19:48 UTC by Luc Lalonde
Modified: 2019-04-18 04:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luc Lalonde 2019-04-15 19:48:46 UTC
I can't seem to get offline backups working.

Here's my environment:
- Samba 4.10.2
- Python 3.6.6
- CentOS 7.6.1810

Command line issued:

samba-tool domain backup offline --targetdir=/home/samba-backup

Result:

py_smbd_create_file: init_files_struct failed: NT_STATUS_INVALID_PARAMETER
.
. multiple repeats of previous line

ERROR(<class 'OSError'>): uncaught exception - [Errno 24] Too many open files: '/tmp/tmpz6unmjap/example.org/scripts'
  File "/usr/local/samba/lib64/python3.6/site-packages/samba/netcmd/__init__.py", line 185, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/samba/lib64/python3.6/site-packages/samba/netcmd/domain_backup.py", line 1091, in run
    backup_offline(paths.sysvol, sysvol_tar, samdb, paths.smbconf)
  File "/usr/local/samba/lib64/python3.6/site-packages/samba/ntacls.py", line 570, in backup_offline
    shutil.rmtree(tempdir)
  File "/usr/lib64/python3.6/shutil.py", line 480, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib64/python3.6/shutil.py", line 418, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib64/python3.6/shutil.py", line 418, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib64/python3.6/shutil.py", line 402, in _rmtree_safe_fd
    onerror(os.listdir, path, sys.exc_info())
  File "/usr/lib64/python3.6/shutil.py", line 399, in _rmtree_safe_fd
    names = os.listdir(topfd)
Comment 1 Douglas Bagnall 2019-04-18 04:18:22 UTC
> ERROR(<class 'OSError'>): uncaught exception - [Errno 24] Too many open files:

Have you tried increasing the limit on the number of open files? 
There are different ways to do that, depending on what kind of limit is set.

We may still have a problem, but that seems like the simplest workaround to try.