backup command raises FileNotFoundError

Bug #1952187 reported by James Dingwall
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)

Bug Description

upstream report with proposed fix:

Since the upgrade in 'focal' to 4.13 the samba domain backup script fails if there is a dangling symbolic link in any of the directories included in the backup.

running backup on dirs: /var/lib/samba/private /var/lib/samba /etc/samba
ERROR(<class 'FileNotFoundError'>): uncaught exception - [Errno 2] No such file or directory: '/var/lib/samba/dfs/netlogon'
  File "/usr/lib/python3/dist-packages/samba/netcmd/", line 186, in _run
    return*args, **kwargs)
  File "/usr/lib/python3/dist-packages/samba/netcmd/", line 1105, in run
    if any(os.path.samefile(full_path, file) for file in all_files):
  File "/usr/lib/python3/dist-packages/samba/netcmd/", line 1105, in <genexpr>
    if any(os.path.samefile(full_path, file) for file in all_files):
  File "/usr/lib/python3.8/", line 100, in samefile
    s1 = os.stat(f1)

$ apt-cache policy samba
  Installed: 2:4.13.14+dfsg-0ubuntu0.20.04.1
  Candidate: 2:4.13.14+dfsg-0ubuntu0.20.04.1
  Version table:
 *** 2:4.13.14+dfsg-0ubuntu0.20.04.1 500
        500 focal-updates/main amd64 Packages
        500 focal-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2:4.11.6+dfsg-0ubuntu1 500
        500 focal/main amd64 Packages

The backup is executed as:

/usr/bin/samba-tool domain backup offline --targetdir="${BACKDIR}"

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.