cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KevinT
Level: Powered On

Server Error: 502 BadGateway SQL Direct Query

Dear all,

I'm writing this here because I really don't know what else I can do about that...

We have been using PowerApps in my company for more than a year now, and it worked just fine, but few months ago without any changes in the app or connections, it started to show time to time "Server Error" messages..

Recently, error messages show more details and I can see it's error code 502.
It shows up sometimes on a label, sometimes on a Droplist, sometimes on a Button..

I have seen other posts but they are related to Flows & Sharepoint, and we don't use neither of those.
We have a DirectQuery connection to our SQL Server database, using a Gateway (installed for Power BI but also used for PowerApps. Gateway status = connected, all ok).

This problem is really unconsistant, but I cannot say that this is someting Punctual, as it happens few times a day...

I attach error message from the PC. In this case it's a simple droplist to our SQL server:
Distinct('[DB].[Table]';Name)              (maybe 20 rows max in this table....)

If it persist, we will have to reconsider using PowerApps at all.

Can you please troubleshoot this?

Thank you and best regards;
Kévin

4 REPLIES 4
bhayden
Level: Powered On

Re: Server Error: 502 BadGateway SQL Direct Query

Hello Kevin,

 

We have been getting these issues as well. Still trying to figure out what is causing them.

I will try to update you if I can get some information.

Deb
Level: Power Up

Re: Server Error: 502 BadGateway SQL Direct Query

Hi Kevin, 

You can try out the following things: 

1) Check if you are using the recent version of the on-premise gateway if not please download and install it ( remember to use the recovery key). 

2) Stop the on-premise gateway service and start it again. 

3) Sign in to the gateway and check the status. 

 

Hopefully this should resolve the issue. 

 

Thanks, 

Deb

 

Super User
Super User

Re: Server Error: 502 BadGateway SQL Direct Query

Hi @KevinT ,

Try and set a primary key on the sql tables being queried
I had a similar issue and creating a primary key on my table resolved it

Administrator
Administrator

Re: Server Error: 502 BadGateway SQL Direct Query

Thanks for posting in the community @KevinT - are you still experiencing this issue? Can you review the above replies and update the thread if they were helpful? 

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 102 members 3,605 guests
Recent signins:
Please welcome our newest community members: