web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Bad Gateway error when...
Power Automate
Unanswered

Bad Gateway error when trying to create a new list on a particular SharePoint site, but no error for a different site

(0) ShareShare
ReportReport
Posted on by 15

I have an issue creating a new list on a particular SharePoint site. When I run the flow, the API actually successfully creates the list called "Test" on the problematic site as I could see the list there, but the same HTTP request action just keeps on running and trying to create the same list that it has created over and over again, which leads to a JSON message saying "A list, survey, discussion board, or document library with the specified title already exists in this Web site.  Please choose another title.\r\nclientRequestId: 2f84732e-7ea8-4d49-91ec-5bbdd98901f3\r\nserviceRequestId: 010ccc9f-c0b2-0000-9612-a1b9904794c4"

 

Here's a screenshot of the flow:

Darren1994_1-1622166283581.png

 

The output after the HTTP request failed to run after 2 retries occurred. 

Body

 

{
 "error": {
 "code": 502,
 "source": "asia-001.azure-apim.net",
 "clientRequestId": "2f84732e-7ea8-4d49-91ec-5bbdd98901f3",
 "message": "BadGateway",
 "innerError": {
 "status": 502,
 "message": "A list, survey, discussion board, or document library with the specified title already exists in this Web site. Please choose another title.\r\nclientRequestId: 2f84732e-7ea8-4d49-91ec-5bbdd98901f3\r\nserviceRequestId: 010ccc9f-c0b2-0000-9612-a1b9904794c4",
 "source": "https://xxxxx.sharepoint.com/sites/xxxxx/_api/web/lists",
 "errors": [
 "-2130575342",
 "Microsoft.SharePoint.SPException"
 ]
 }
 }
}

 

 

 

Header

{
 "Pragma": "no-cache",
 "x-ms-request-id": "010ccc9f-c0b2-0000-9612-a1b9904794c4",
 "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
 "X-Content-Type-Options": "nosniff",
 "X-Frame-Options": "DENY",
 "Cache-Control": "no-store, no-cache",
 "Set-Cookie": "ARRAffinity=07abb3f274a938ebb08283001fd69ce1b96d646206f80f6a9e686683a0b031f8;Path=/;HttpOnly;Secure;Domain=sharepointonline-sea.azconn-sea.p.azurewebsites.net,ARRAffinitySameSite=07abb3f274a938ebb08283001fd69ce1b96d646206f80f6a9e686683a0b031f8;Path=/;HttpOnly;SameSite=None;Secure;Domain=sharepointonline-sea.azconn-sea.p.azurewebsites.net",
 "Timing-Allow-Origin": "*",
 "x-ms-apihub-cached-response": "true",
 "Date": "Thu, 27 May 2021 16:05:56 GMT",
 "Content-Length": "675",
 "Content-Type": "application/json",
 "Expires": "-1"
}

 

 

Please note that the same flow works perfectly on a different SharePoint site. Could my company have made some setting changes for the problematic site that led to the problem? Because I was able to run this flow on the problematic page the day before yesterday. Please assist me on this.

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Darren1994  can you please set the Retry policy to None for Send HTTP Request to SharePoint action and test the flow on problematic site? Also please make sure before running the flow, there is no list named Test on that site.

    annajhaveri_0-1622188155191.png

     

  • Verified answer
    Darren1994 Profile Picture
    15 on at

    Thank you for your response. I have set Retry Policy to None, and the action fails immediately upon first attempt, but it did successfully create the list I wanted to create.

     

    Apart from setting Retry Policy to None for the action, I had to set the other action (after the one to create a list) to continue running, even after the previous action failed. My automation flow works fine by doing that, even though that particular action has "failed" after creating the list (still the same Bad Gateway).

     

    Screenshot of my workaround below:

    Darren1994_0-1622194333869.png

     

    and the flow history looks like this:

    Darren1994_1-1622194399533.png

     

    Even though the "Create a new list" action fails due to Bad Gateway, it fails AFTER it creates the list that I specified. So functionally it's working, and I can add columns for that list and so on after that.

     

    Also, I do not have any list named "Test". Each time I re-run the flow, I'll delete the "Test" list beforehand.

    I'll just have to use this workaround for the time being.

     

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Darren1994  okay thats weird behavior, but its good that you have alternate solution. With SharePoint Designer -> going to all files and checking if you can find the list there after it is deleted, or use PowerShell to get the lists/test folder to know more why SharePoint is behaving in this manner. I am not whether you tried using different list name or not, if not then can try that.

  • Darren1994 Profile Picture
    15 on at

    @annajhaveri  I have tried using different list names, names that have never been used before and I still get the same Bad Gateway error. The API is able to successfully create a list the first time, but even after creating the list, it just keeps on attempting to create the same list over and over again and never stops, and I do not know why. That is likely the cause of the Gateway Error (trying to create a list where the name is already in use).

     

    My only concern is why does the API keeps on creating the same list in one action and not stop there after it has been successfully created? Moreover, it doesn't happen to other SharePoint sites, just the one I'm working on. In the meantime, I'll just stick with the current workaround and explore the root cause in future. Thank you for your response.

     

  • Justin_Harvey Profile Picture
    5 on at

    You saved my bacon. I've been stuck on the same issue for ages. I figured it was due to some throttling or something, but your workaround has helped me get back on track. Thanks! 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard