ERROR_ACCESS_DENIED: Access is denied. [CopyFileEx]

Get help for specific problems
Posts: 6
Joined: 22 Feb 2021

cbuae

Cannot copy file
"C:\Users\User\OneDrive - XYZ\abc\signed.pdf" to
""C:\Users\User\OneDrive - ABC\abc\signed.pdf"".

ERROR_ACCESS_DENIED: Access is denied. [CopyFileEx]

Copying files from a one drive desktop sync folder to another folder.
Checked all permissions etc, it was working fine for about 3 years and now suddenly it is giving this error, haven't changed anything anywhere. Same access same details same permissions. If i uninstall the one drive client and reinstall it it works fine for a couple of times and then again gives the same error for all files.

Has something to do with the One drive folder functionality. Anyone else had the same issue please help.
User avatar
Site Admin
Posts: 7210
Joined: 9 Dec 2007

Zenju

Where are the double double quotes coming from?
Posts: 6
Joined: 22 Feb 2021

cbuae

The double quotes are a typing error, please ignore it.

Cannot copy file
"C:\Users\User\OneDrive - XYZ\abc\signed.pdf" to
"C:\Users\User\OneDrive - ABC\abc\signed.pdf".

ERROR_ACCESS_DENIED: Access is denied. [CopyFileEx]
Posts: 292
Joined: 13 Apr 2017

Gianni1962

Are you sure that the OneDrive base folders are "OneDrive - XYZ" and "One Drive - ABC" ?
Two different OneDrive accounts?
User avatar
Posts: 4056
Joined: 11 Jun 2019

xCSxXenon

Probably syncing a business and personal account. Unlink the destination account and set it back up
Posts: 6
Joined: 22 Feb 2021

cbuae

Its the same One Drive Account ( Business ) Synching from one folder to another in the same one drive account. The one drive folder syncs to windows desktop local folder. The sync is setup from one local folder to another within this one drive sync folder (local) on windows. The same setup was working fine till last month. It has been working absolutely fine since last 1 year. This happens on a windows 10 machine. All of sudden this issue has come up. Same setup with same account and permission level ( and same folders synching) is installed on another machine running server 2016 and that works fine. Don't know what is wrong here. I have tried unlinking the destination and creating a new sync folder for one drive. The first iteration works fine. But if you run it again it just gives multiple errors. Please help
Posts: 292
Joined: 13 Apr 2017

Gianni1962

If the sync setup is from two folders in the same OneDrive account why the OneDrive folder names you have given are different?
A typo?

Give us the true error message, censoring with more care, and telling us clearly what you have censored.

The Windows username under which you are running the sync is the same who own the OneDrive folder?
Posts: 6
Joined: 22 Feb 2021

cbuae

Actual Error Message

Cannot copy file
"C:\Users\User\OneDrive - CRAE\TBR-CC\BB\2021\3. MARCH\RT\CW40.pdf" to
"C:\Users\User\OneDrive - CRAE\Main Data\BB\2021\3. MARCH\RT\CW40~3e6d.ffs_tmp".

ERROR_ACCESS_DENIED: Access is denied. [CopyFileEx]


The Windows Username is the same as who owns the OneDriver Folder. Only one user in the workstation.
Like i said before, the same setup was working for over a year and a half, stopped working all of a sudden. I am not sure if it was because of a windows update or something.
Posts: 292
Joined: 13 Apr 2017

Gianni1962

If you ignore this error does the sync go on and completes?

What antivirus is installed?
Windows Defender or something else?

Try a sync with the antivirus disabled.
Posts: 6
Joined: 22 Feb 2021

cbuae

If i ignore the error the sycn finishes with errors and no files are updated

I have Avast Free Antivirus. Have already tried disabling the antivirus, same error.
Windows Defender is Disabled

I have even reinstalled both filesync and onedrive clients, it syncs for the first time sucessfully. but when we do a second re-run, the error starts popping up. The Sync type is Update files in one folder, so it looks for changes in the source folder and updates the files in the destination folder.

Same setup for same configuration / account / onedrive profile / folders works fine on another machine which is running windows server 2016 when i tried.
Posts: 6
Joined: 22 Feb 2021

cbuae

If fact even if i am trying to sync files from the one drive location to an network location external. that is also not happening
Posts: 292
Joined: 13 Apr 2017

Gianni1962

Try this:
- unlink the OneDrive account
- delete completely or move elsewhere the "C:\Users\User\OneDrive" folder
- create "C:\Users\User\OneDrive" folder
- link the OneDrive account and be sure to connect to the "C:\Users\User\OneDrive" folder
- don't use the OneDrive option "Files On-Demand"
Save disk space with OneDrive Files On-Demand for Windows 10
- wait until OneDrive is synced

Retry the FFS sync.
User avatar
Posts: 4056
Joined: 11 Jun 2019

xCSxXenon

Since the errors seem to be coming from the source side, what are the permissions on those files in the source? Are they actually on the local drive, or just "on-demand"?
User avatar
Site Admin
Posts: 7210
Joined: 9 Dec 2007

Zenju

I'd suggest running a Process Monitor trace: https://freefilesync.org/faq.php#trace
It's quite possible there's an interference with another program, e.g. AV, which updates threat signatures all the time, thous would explain why this problem occurs all of a sudden.