Showing results for 
Search instead for 
Did you mean: 

SharePoint copy file action falsely reports 404 missing file



I was running a training class yesterday and tthe class hit this issue. Here is how to repro:


Firstly, I used the SharePoint copy file action with the following config:


Trigger: "When a file is created or modified (properties only)"




Source doclib: "/Sarahs QAP docs"

Destination doclib: "/QAP Docs Published"


The copy action currently looks as follows: As you can see I pull the file name from the trigger and note that I have removed the leading slash from the destination File Path. Also note that right now I have hard-coded the destination file name to test.docx.



So now I ensure that in the destination library that test.docx does not exist.




As you can see the library is emtpy. So I edit the properties of a document in the source library to trigger the flow, and it works ok...



Now watch what happens when I do it again..... I edit the properties on the same soiurce file to trigger a second flow run...



The error can be seen in the message above, but it is subtle... Of course, we know the document does exist because the first iteration placed it there. Taking a closer look, I see the web service call causing the fault...


"source": "'"


I paste this web service call into a browser and confirm the same error that the file in the above path does not exist.




But take a look at the URL in the message above... see the extra slash?  I confirmed this by decoding the URL. You can see an extra encoded slash still there...'/sites/PAAuckland/%2fQAP+Docs+Published%2ftest.docx'


If I remove this slash and hit the URL manually I get a positve result... eg:



Essentially until this issue is fixed, the copy file action for SharePoint is broken...





Advocate V
Advocate V

Re: SharePoint copy file action falsely reports 404 missing file

Worked on a similar MS Flow.

Flow Logic:  

  1. When new item is created in a list, copy doc from source document library to target document library.
  2. Use New name at target library.

Work perfectly except if target has a document with the same name.  i.e. if document already exists at target.


MS flow has an Overwrite Flag - presumably to allow for replacing existing documents (at the target).

This however doesn't work. MS Flow fails consistently whenever document exists at the target.



Error Message:

CopyFileFails Message.jpg





Not applicable

Re: SharePoint copy file action falsely reports 404 missing file

This is quite possibly related to sharepoint's ServerRelativeUrl returning / on the rootweb, but without a trailing slash on subwebs.

Advocate III
Advocate III

Re: SharePoint copy file action falsely reports 404 missing file

I confirm that this is not fixed yet.

This is very annoying, since the only other reliable way is to use Get File Contents followed by Create File.

But this means 2xFileSize data transfers each time. Combined with 50MB limit, this is not a solution!


New Member

Re: SharePoint copy file action falsely reports 404 missing file

First let's confirm the file path (Web Address) of the document library using the library settings. Confirm File Path in Document Library Settings.PNG



As you can see, it is possible to have a different Quick Launch link and Library name than the actual Library path (Web Address). I've seen site owners have similar issues and it's usually the incorrect document library path, file name or syntax. The file name is required with this action; having the path alone will also return a similar failure summary.


Looking at your flow, I see that in the Source File Path of the Sharepoint Copy file action you are adding '.docx' after the 'Name' dynamic content. Remove the 'docx' and 'Name dynamic content. If you want to include the file extension, use the 'File name with extension' dynamic content. i.e /Sarahs QAP docs/'File name with extension'


Secondly, the Destination Soure path should have similar dynamic content as the source file path. Try using /QAP Docs Published/'File name with extension'

This is assuming both paths are the same as the Web Address listed in the document library settings. An example of an presumed path is below:


Assumed Path.PNG


Failure Summary of assumed path.PNG




Here's a successful overview of my example Publication Process flow:


Overall Flow.PNG


Details on changed action properties to make a successful flow:


Copy Success Example.PNG


Move Process Details based on approvers response.PNG

 Hope this helps. Smiley Happy




New Member

Re: SharePoint copy file action falsely reports 404 missing file

Using "When file is created or modified in a folder" event trigger after duplicating the file solved the problem

Helpful resources


August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!


Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (4,584)