cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KvB1
Solution Sage
Solution Sage

Error 409

I have an automate that uploads an attachment. It has been working fine for a number of months. 

 

Recently, it failed due to a Error 409. After looking it up I found that this is caused by a conflict within the file. Could mean it is a shared file that has changes made to it, or references to another file.

 

However the file that caused the automate to fail is a simple .txt file, that isn't shared with another user. When I tested the automate again using the exact same file, I couldn't replicate the error.

 

Can anyone help me preventing this error from happening in the future?

1 ACCEPTED SOLUTION

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @KvB1 ,

 

Thank you for the very detailed explanation.

 

There is definitely a fair bit going on at the same time.  Are you passing the ID from the PowerApp or is it another value, hence the need for Get Items instead of Get Item?  I would suggest putting some error handling and retry logic into the flows.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

 

 

View solution in original post

4 REPLIES 4
eric-cheng
Solution Sage
Solution Sage

Hi @KvB1 ,

 

As you already alluded to, there appears to be a conflict somewhere.


Can you share a screenshot of your flow?

 

Are you copying and uploading large volumes of files?  Have you enabled concurrency?  Do you have multiple flows performing an action on the same library at the same time?

 

You can also look at implementing some retry logic here whilst you investigate the issue and then retry the action again.

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Hi @eric-cheng, thanks for replying.

 

This is the flow that gave an error:

KvB1_0-1632475391209.png

It is very simple. From PowerApps 2 values are taken: a unique value used to grab an item from a sharepoint list, and the contents of the file. The flow then adds this file as an attachment to said item. However,  it is possible for multiple files to need to be attached to the same list item. The Run( for the automate sits in a ForAll( function in the app. Since the first file was a very small .txt file I can imagine that the automates ran almost simultaneously.

 

Additonally, under the same OnSelect in the app as the automate that gave the error, another automate is triggered, which adds an additional file to the list item, which happens to each list item and is a file the user has no control over.

 

A third automate is also triggered which grabs all list items that are connected to the list item in the app, puts all the columns of those items in a table, grabs all the attachments of all list items, and combines all of that in a PDF. This last automate is on a 10sec delay and doesnt edit the list items in any way, so i can't imagine that its a problem.

 

What I can imagine is that this conflict arises when 2 flows try to edit the same list item by adding an attachment, so I will look into that.

 

Do you happen to know if its possible for this to happen when the automate triggers are situated in a ForAll in the app, or does this exclude this possibility by the nature of the ForAll function?

eric-cheng
Solution Sage
Solution Sage

Hi @KvB1 ,

 

Thank you for the very detailed explanation.

 

There is definitely a fair bit going on at the same time.  Are you passing the ID from the PowerApp or is it another value, hence the need for Get Items instead of Get Item?  I would suggest putting some error handling and retry logic into the flows.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

 

 

Hi @eric-cheng 

It is another value, hence Get Items.

 

The app generates a random number, which is the number for the batch of items a user will input via the app. Per item, the user can add a file, which the automate will store as an attachment to the relevant item in the list.

 

The last entered item in the batch will receive a unique attachment, using a different automate but using the same random number generated by the app in the trigger.

 

I suspect the 409 error comes from a conflict when both automates try to add an attachment to the same item. What I'm thinking of as a solution is simply to put a delay on the second automate, in combination with error handling.

 

Thanks for your help!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,479)