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)
> 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.
(In reply to Douglas Bagnall from comment #1) If I do a "cat /proc/sys/fs/file-max", here's what I get: 398302 What would you suggest I increase this to?
I saw something similar on restore. a ulimit -n 819200 before fixed it. But we should fix the fd leak...
(In reply to Stefan Metzmacher from comment #3) Ok thanks. I'll use the old backup script for the moment... until the leak gets fixed.
This is still a bug with version 4.12.5 The ulimit command is helpful in getting past it.
This bug was referenced in samba master: d8fa464a2dfb11df4e1db4ebffe8bd28ff118c75
Karo, the commit should also be cherry-picked to the supported release branches.
(In reply to Björn Jacke from comment #7) Pushed to autobuild-v4-{14,13,12-test}.
This bug was referenced in samba v4-13-test: 5957cf2e2ca6265f233803c23212d307c3ccf530
This bug was referenced in samba v4-14-test: ecb41890f10e497a1dc1e25499b44538856af6f0
This bug was referenced in samba v4-12-test: 6382ca8568219a1ba54bc05d24ccbff019240cfe
This bug was referenced in samba v4-14-stable (Release samba-4.14.0rc3): ecb41890f10e497a1dc1e25499b44538856af6f0
This bug was referenced in samba v4-13-stable (Release samba-4.13.5): 5957cf2e2ca6265f233803c23212d307c3ccf530
This bug was referenced in samba v4-12-stable (Release samba-4.12.12): 6382ca8568219a1ba54bc05d24ccbff019240cfe