ERROR_FILE_EXISTS [CopyFileEx] on Samba share

Get help for specific problems
Posts: 21
Joined: 18 Feb 2020

donauinsel

In my case its a special character in files stored in user directory.
Attachments
Zwischenablage02.jpg
Zwischenablage02.jpg (8.43 KiB) Viewed 3657 times
Zwischenablage01.jpg
Zwischenablage01.jpg (20.5 KiB) Viewed 3657 times
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

In my case its a special character in files stored in user directory. donauinsel, 28 Jul 2022, 07:49
I suspect there is something else going on. FreeFileSync supports Unicode fully, including emojis.
Posts: 2
Joined: 13 Sep 2022

kamkie

beta insaller has expired
Attachments
Screenshot 2022-09-13 143445.png
Screenshot 2022-09-13 143445.png (11.61 KiB) Viewed 3549 times
Posts: 3
Joined: 18 Sep 2022

schakie

Unfortunetely looks like there's still no solution..

I just switched to a fresh Win10 installation (build 19044.2006) with FFS V11.25 and now I'm getting the same error:
ERROR_FILE_EXISTS: Die Datei ist vorhanden. [CopyFileEx]

Process monitor also shows the mentioned lines:
13:59:47,4011888    FreeFileSync_x64.exe    13908    CreateFile   
\\dose2\Daten\User\x\Backup\Favoriten\bookmark~4525.ffs_tmp   
EAS NOT SUPPORTED   
Desired Access: Generic Read/Write, Delete, Write DAC, Disposition: Create, Options: Sequential Access, Non-Directory File, Attributes: A, ShareMode: None, AllocationSize: 14.153

13:59:47,4153934    FreeFileSync_x64.exe    13908    CreateFile   
\\dose2\Daten\User\x\Backup\Favoriten\bookmark~4525.ffs_tmp   
NAME COLLISION   
Desired Access: Generic Write, Read Data/List Directory, Read Attributes, Delete, Write DAC, Disposition: Create, Options: Sequential Access, Non-Directory File, Attributes: A, ShareMode: None, AllocationSize: 14.153

13:59:47,4242228    FreeFileSync_x64.exe    13908    CreateFile   
\\dose2\Daten\User\x\Backup\Favoriten\bookmark~4525.ffs_tmp   
NAME COLLISION   
Desired Access: Generic Write, Read Attributes, Delete, Write DAC, Disposition: Create, Options: Sequential Access, Non-Directory File, Attributes: A, ShareMode: None, AllocationSize: 14.153

13:59:47,4474411    FreeFileSync_x64.exe    13908    CreateFile   
\\dose2\Daten\User\x\Backup\Favoriten\bookmark~4525.ffs_tmp   
NAME NOT FOUND   
Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
Get-SmbConnection shows I'm using SMB V2.1 for connection to my QNAP NAS

I will be happy to assist with testing betas etc..
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

EAS NOT SUPPORTED schakie, 18 Sep 2022, 12:47
That's definitively the SMB bug that FFS could try to workaround. I'll prepare new beta versions for testing.
Posts: 3
Joined: 18 Sep 2022

schakie

both betas are working, showing no error, copying the intended file and leaving no .ffs_tmp file behind.

Also when I reinstalled 11.25 Release version the error came back (as expected).

I sent you the PML files...
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

both betas are working, showing no error, copying the intended file and leaving no .ffs_tmp file behind.

Also when I reinstalled 11.25 Release version the error came back (as expected).

I sent you the PML files... schakie, 21 Sep 2022, 18:02
Thank you very much! The workaround is doing as expected according to the PML files. The fix will be officially available in the next version FreeFileSync 11.26.
Posts: 3
Joined: 18 Sep 2022

schakie

Cool, thank you!
In the meantime I'll use the beta...
Posts: 1
Joined: 29 Jan 2024

edechamps

Hi,

I am not a FFS user, however I stumbled upon this thread while trying to understand why I was getting empty files being created and weird "The destination already has a file named X" errors from Explorer while attempting to copy files to a Samba share.

This is indeed a Samba bug, and I took the liberty of filing it against them: https://bugzilla.samba.org/show_bug.cgi?id=15563

The bug happens when Samba is configured with `ea support` enabled (note this is the case by default starting from Samba 4.9) and one attempts to create a file with extended attributes and the underlying filesystem does not support user xattrs.

Probably the cleanest solution is to ensure Samba is serving from a filesystem with user xattrs support.

Otherwise, a workaround is to explicitly set `ea support` to `no` in Samba smb.conf. This will disable extended attributes, but those are rarely useful, and this makes no difference if the underlying filesystem doesn't support them anyway.
User avatar
Posts: 8
Joined: 8 Sep 2019

pkiff

Interesting discovery @edechamps. Thanks for your work on this and for dropping a note in here. I may see if I can fiddle with my smb conf settings on my NAS - though I haven't encountered the errors in FFS for a while now.