After Ubuntu 18.04 upgrade: "Failed to process metadata" warnings backing up cifs-mounted share

I’m posting this to share how I addressed the issue described below, but, as a warning, I’m not well versed in any of the underlying details and this may not be a reasonable or sensible thought process.

I recently upgraded my primary duplicati machine from Ubuntu 16.04 to 18.04 (Bionic Beaver). I have a backup source that is mounted via CIFS/samba and while I know that this is not really a supported configuration, it has worked well for me in the past.

After the 18.04 upgrade, the backup task for the CIFS-mounted source started generating thousands of warning messages like this:

Warnings: [
    Failed to process metadata for "/backupmnt/share/", storing empty metadata => Unable to access the file "/backupmnt/share" with method llistxattr, error: ENODATA (61),
    Failed to process metadata for "/backupmnt/share/x.doc", storing empty metadata => Unable to access the file "/backupmnt/share/x.doc" with method llistxattr, error: ENODATA (61),
    Failed to process metadata for "/backupmnt/share/y.html", storing empty metadata => Unable to access the file "/backupmnt/share/y.html" with method llistxattr, error: ENODATA (61),
    Failed to process metadata for "/backupmnt/share/z/", storing empty metadata => Unable to access the file "/backupmnt/share/z" with method llistxattr, error: ENODATA (61),
    Failed to process metadata for "/backupmnt/share/n/", storing empty metadata => Unable to access the file "/backupmnt/share/n" with method llistxattr, error: ENODATA (61),
	.
	.
	.
	.
	.
]

This seems extremely similar to what was discussed at https://forum.duplicati.com/t/getting-odd-metadata-errors/1710/ but I wasn’t initially clear on what about the 18.04 Bionic upgrade could have contributed to the change from no warnings to tons of warnings.

I noticed that under Ubuntu 16.04 I was using Samba 4.6.7 and with 18.04 Samba had been upgraded to 4.7.6. mount.cifs is newer too, and I’m sure that many other underlying pieces that are used directly or indirectly for cifs mounts are newer. The important thing seems to be that under 16.04, using xattr on anything from my cifs-mounted share results in this:

user@duplicatibox:~$ xattr /backupmnt/share/x.doc
[**Errno 95**] Operation not supported: b'/backupmnt/share/x.doc'
user@duplicatibox:~$

and on 18.04, with whatever relevant changes are implied by that upgrade and no other changes to the environment, the same thing results in this:

user@duplicatibox:~$ xattr /backupmnt/share/x.doc
[**Errno 6**1] No data available: b'/backupmnt/share/x.doc'
user@duplicatibox:~$

It seems clear that the reason the warnings didn’t show up before is because Errno 95 is explicitly ignored already whereas Errno 61 is not (but maybe soon it will be, as mentioned in the last link).

I see that I probably could have avoided the problem entirely by adding the --skip-metadata option to the backup task, but in my limited understanding of what that does, it would seem that more fundamental timestamp info that is not acquired via xattr would not be stored/restored, and I want to preserve that stuff if possible. If I’m wrong about that, then I have missed the most simple solution.

Ultimately, what I did to suppress the warnings was to add the ‘nouser_xattr’ option to the fstab entry for my mounted share:

//server/share /backupmnt/share/ cifs credentials=/etc/blah,nouser_xattr,ro 0 0

Now, xattr returns the following again since nouser_xattr "Do[es] not allow getfattr/setfattr to get/set xattrs, even if server would support it otherwise.:

user@duplicatibox:~$ xattr /backupmnt/share/x.doc
[Errno 95] Operation not supported: b'/backupmnt/share/x.doc'
user@duplicatibox:~$

and Duplicati happily suppresses the warnings which works for me!

2 Likes

Thanks for your post as I think that it will be a big help to me solving my original issue as on the earlier post you mention. I’m using Manjaro but because of this will have been using a newer version of Samba for a while. I would presume that this is what has caused the xattr warnings too.

Your digging into the issue using the xattr cmd is great and I follow your logic. I would guess that as more folk upgrade from Ubuntu 16.04 to 18.04 (and other reliant distros such as Mint too) that this set of errors/warnings will become greater .

I will try your fix re amending the fstab, and try again. I’ll report back if this fixes the issue for me.

I just added your tweak to my fstab and yes the xattr warnings have disappeared :wink:

Many thanks for your post. I’m sure it will help others too.

Thanks for the feedback! I’m really glad that this was helpful!

The root of that cause I’ve found is security permissions set by previous versions of Windows (2000, XP, Vista, Server 2003) on older Microsoft Office/Word files such as those .doc files. I have been dealing with 300+ of these kind of files that have been around in the company at least since 2008 and older, some as far back as 2001 (long before I got here). Since the network security, file backups, storage uses have varied through the years (per user permissions per computer set manually by IT, early windows networking via Windows 3.1 and 98, Citrix, then an early active directory, then newer current active directory), permissions for those older files and folders can really get screwed up after systems and access have changed half a dozen times.

So do you know if the issue is that newer versions of samba (starting sometime between 4.6.7 and 4.7.6) don’t correctly support the older permissions settings on the files or is it that they now DO correctly support them and are reporting legitimate errors?

(Of course either way, the issue is with Samba, not Duplicati.)

I found that specific error is due to the file permissions/security settings, which Duplicati is picking up as a legitimate error… At least in my experience, since I am using Windows Server connecting to other Windows servers (2003, 2008, and 2012), they are all using SMB directly, so not related to version of Samba in Linux.

@Bob_Marley, just a quick note that after I ran an apt-get update and apt-get upgrade yesterday on my 16.04 box I am seeing this error as well.

Your suggested fix of nouser_xattr is working (in my case I’m using it in a mount command since I mount and unmount shares as needed for the backup.

Thank you again!

That’s excellent – thanks for the info!

For those that might care, I’ve added this to GitHub: