Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

504 Bad Gateway when running "Find files in folder by path" action for OneDrive for Business connection

(0) ShareShare
ReportReport
Posted on by 2

I have a flow which searches a user's OneDrive folder. It works for myself and the other users, apart from one. This user receives a 504 Bad Gateway error. 

 

Relevant Steps 

Failure 

 

I have had the user delete their connection to OneDrive and re-run the flow, but this has not helped. I have also had them run a simple flow which uses the "List files in root folder" action for OneDrive for Business, and this also seems to work for them.

 

What could be the issue with this user not being able to search their OneDrive for Business?

  • adamswanson Profile Picture
    2 on at
    Re: 504 Bad Gateway when running "Find files in folder by path" action for OneDrive for Business connection

    Here is the full Headers and Body output from the flow:

     

    Headers

    Pragmano-cache
    Transfer-Encodingchunked
    x-ms-datasourceerror

    True

    x-ms-request-id75d0ac25-c2a0-4fb1-8cc3-320e...
    Timing-Allow-Origin*
    x-ms-apihub-cached-responsetrue
    Connectionclose
    Cache-Controlno-cache
    DateMon, 09 Mar 2020 16:09:36 G...
    X-AspNet-Version4.0.30319
    X-Powered-ByASP.NET
    Content-Typeapplication/json
    Expires-1
    Content-Length362

     

    Body

     

    {
     "error": {
     "code": 504,
     "source": "unitedstates-002.azure-apim.net",
     "clientRequestId": "75d0ac25-c2a0-4fb1-8cc3-320ebcc2c4d3",
     "message": "BadGateway",
     "innerError": {
     "status": 504,
     "message": "Request timed out.\r\n inner exception: A task was canceled.",
     "source": "api.connectorp.svc.ms"
     }
     }
    }

     

     

    Please remember, this is ONLY happening for some users. It works fine for others.

     

    Regarding your suggestion to try entering a the Folder Path and Search Query manually and switching to OneDriveSearch, this does not seem to error out for one of the users, but it also does not find the file in the search query for that user nor for myself. I suspect there is a bug in using OneDriveSearch: 

     

    Screenshot of the modified search step

    Screenshot of the contents of the searched folder

     

    As you can see from the screenshots, the file I am searching for exists, but does not come up using your suggested method.

  • v-alzhan-msft Profile Picture
    on at
    Re: 504 Bad Gateway when running "Find files in folder by path" action for OneDrive for Business connection

    Hi @adamswanson ,

     

    Could you please share more details about the error message in the flow?

    I have made a test on my side and don't have the issue that you mentioned.

    Please set the File Search Mode field to OneDriveSearch. Within Folder Path field, type your Folder Path manually, and the query field could be file type such as docx, xlsx.

    1.png

    Hope the link below could be your referance:

    https://powerusers.microsoft.com/t5/Building-Flows/Find-files-in-folder/td-p/113605

     

    Best Regards,

    Alice

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow