Error Code 2: The system cannot find the file specified. (CopyFileEx)

Get help for specific problems
Posts: 12
Joined: 12 Jun 2014

eringobra

The files themselves are there, I am an administrator on the file server its being synced from (and to) and the Administrators group has Full Access.

It isn't hidden and isn't read-only. If I choose to Ignore this and the other files that I receive the same error on, the sync completes with those exceptions.

Help?
Posts: 12
Joined: 12 Jun 2014

eringobra

Some more info:

Left (source) is the file server that FFS is installed on. Right (destination) is a Synology NAS shared folder, which is a mapped drive \\ipaddress\sharename. I have also tried it without mapping the drive and using \\ipaddress\sharename and \\servername\sharename.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Have you tried using Windows Explorer to copy the files and see if that works?
Posts: 12
Joined: 12 Jun 2014

eringobra

Have you tried using Windows Explorer to copy the files and see if that works?Zenju
Thank you for replying Zenju.

As a workaround to get all my files copied over, yes. I copied them from a full backup taken with BackupAssist into the NAS folder where I wanted them to reside for the 'sync' backups. Afterwards I ran another sync, the errors were gone.

I'm concerned this will continue to happen though, do you know what the issue could be, what I could try? Other files in the same folders with the same permissions transfer without an issue.

I want FFS to be my permanent sync solution, but if this problem persists with random files, it will become time consuming.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Next time you encounter this issue (and can confirm externally, e.g. via Windows Explorer that it's indeed an unexpected error rather than the source or target file really missing at the time), start up a Process Monitor (https://technet.microsoft.com/de-de/sysinternals/bb896645.aspx) trace, retry the operation and let it fail, stop the trace and send the pml file to me via email for analysis.
+ include a few screenshots showing the scenario and error messages.
Posts: 12
Joined: 12 Jun 2014

eringobra

Next time you encounter this issue (and can confirm externally, e.g. via Windows Explorer that it's indeed an unexpected error rather than the source or target file really missing at the time), start up a Process Monitor (https://technet.microsoft.com/de-de/sysinternals/bb896645.aspx) trace, retry the operation and let it fail, stop the trace and send the pml file to me via email for analysis.
+ include a few screenshots showing the scenario and error messages.Zenju
Will do, when I have time (probably tomorrow) I will just remove the problematic file from the destination to reproduce and get you the logs.
Posts: 12
Joined: 12 Jun 2014

eringobra

Next time you encounter this issue (and can confirm externally, e.g. via Windows Explorer that it's indeed an unexpected error rather than the source or target file really missing at the time), start up a Process Monitor (https://technet.microsoft.com/de-de/sysinternals/bb896645.aspx) trace, retry the operation and let it fail, stop the trace and send the pml file to me via email for analysis.
+ include a few screenshots showing the scenario and error messages.Zenju
Hi Zenju,

Attached is the PML file but I would rather not attach screenshots publicly for security reasons. I will privately message you with those.

Thank you!
Posts: 12
Joined: 12 Jun 2014

eringobra

Next time you encounter this issue (and can confirm externally, e.g. via Windows Explorer that it's indeed an unexpected error rather than the source or target file really missing at the time), start up a Process Monitor (https://technet.microsoft.com/de-de/sysinternals/bb896645.aspx) trace, retry the operation and let it fail, stop the trace and send the pml file to me via email for analysis.
+ include a few screenshots showing the scenario and error messages.Zenju
I sent a second message with the URLs. You can't attach files to private messages. I also can't send another message for 45 minutes - apparently sending 2 of them in a short time period is a security risk?

Anyway, let me know if you got them. If not, I'll try to find another way to send the screenshots.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

The file copying of "Conor Lynch signature.jpg" fails when trying to copy a file with an alternate data stream called "AFP_Resource". There are two things that are strange:

1. The creation of the ADS "AFP_Resource" on the network share succeeded, so there is no reason why a later step would fail with "NAME_NOT_FOUND".

2. File copying previously copied the ADS "AFP_RESOURCE" with success, which has the same name, but different case. Some conflict?
Posts: 12
Joined: 12 Jun 2014

eringobra

The file copying of "Conor Lynch signature.jpg" fails when trying to copy a file with an alternate data stream called "AFP_Resource". There are two things that are strange:

1. The creation of the ADS "AFP_Resource" on the network share succeeded, so there is no reason why a later step would fail with "NAME_NOT_FOUND".

2. File copying previously copied the ADS "AFP_RESOURCE" with success, which has the same name, but different case. Some conflict?Zenju
Hi Zenju,

I sent the screenshots privately for security reasons. If you could please not post any more screenshots on this discussion, I would appreciate it.

I see what you're seeing in the log, but I don't understand what this means or what needs to be done with it. I don't see a file "afp_resource"...?
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Talking about the (security-) elephant in the room: you posted the .pml file publicly above containing a lot more than what's on the screenshots...
Posts: 12
Joined: 12 Jun 2014

eringobra

Talking about the (security-) elephant in the room: you posted the .pml file publicly above containing a lot more than what's on the screenshots...Zenju
You're right, and I've deleted it.

I have the same error on new files I tried to sync today. Do you have any advice on how to remedy?
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

I'm not quite sure why an error occurs in this situation. The only safe thing to say is that it's happening outside of FFS's control and is either a bug in Microsoft's CopyFileEx, or in the network drivers, or by the network server.
It's a CopyFileEx bug in any case, but MS could argue that a file with these ADS streams is corrupt anyway:

:AFP_RESOURCE:$DATA
:AFP_Resource:$DATA (size 0)

From FFS's perspective there is one thing we could try, though: use a different copy routine in this case:

[404, Invalid URL: https://freefilesync.org/FreeFileSync_7.1_test3_Windows_Setup.exe]
Posts: 12
Joined: 12 Jun 2014

eringobra

I'm not quite sure why an error occurs in this situation. The only safe thing to say is that it's happening outside of FFS's control and is either a bug in Microsoft's CopyFileEx, or in the network drivers, or by the network server.
It's a CopyFileEx bug in any case, but MS could argue that a file with these ADS streams is corrupt anyway:

:AFP_RESOURCE:$DATA
:AFP_Resource:$DATA (size 0)

From FFS's perspective there is one thing we could try, though: use a different copy routine in this case:

[404, Invalid URL: https://freefilesync.org/FreeFileSync_7.1_test3_Windows_Setup.exe]Zenju
Awesome!! I installed that version locally, ran a sync of three of the problem files, and they copied successfully. Then I did another sync from the File Server where I originally ran it, and it recognized that the files were already there and didn't try to recopy.

Only thing... Whenever I open the new program, I got this error six times:

The program can't start because MSVCR120D.dll is missing from your computer. Try reinstalling the program to fix this problem.

As long as I keep clicking OK, it lets me in and lets me do the sync. This is only on the newest install file you gave me, the older version I had before didn't generate this error.

Thank you for keeping up with this resolution!
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Great, I've incorporated the changes into the current beta. Let me know if there are any issues:
[404, Invalid URL: https://freefilesync.org/FreeFileSync_7.1_beta_Windows_Setup.exe]
Posts: 12
Joined: 12 Jun 2014

eringobra

I installed the beta and that fixed the error messages, tested on a couple of known problem files and they synched fine.

I'll wait until it comes out of beta before I install on my server, but everything works great now. Thanks again!