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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / An error occurred on t...
Power Apps
Unanswered

An error occurred on the server.

(1) ShareShare
ReportReport
Posted on by 171

Hi,

 

I keep getting this sporadic error in an app.

A red bar at the top saying 'An error occurred on the server.'

 

I have tried to track it down but it happens at different times and in different places within the app.

I had a look at the F12 console to see if there was anything useful and found an error popping up that corresponds to the error on screen:

POST https://europe-001.azure-apim.net/invoke 502

on further inspection, I find the following error in a request.

{error: {code: 502, source: "europe-001.azure-apim.net",…}}
error: {code: 502, source: "europe-001.azure-apim.net",…}
clientRequestId: "b675ef21-40d3-4b48-acad-3abc1aee298a"
code: 502
innerError: {status: 502,…}
message: "Unexpected Exception : [0]Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.RuntimeCheckFailedException: Internal error: gatewayAndUserInfo
↵ TemplateMessage: A runtime check error occurred: 
↵
↵GatewayPipelineErrorCode=DM_GWPipeline_UnknownError
↵GatewayVersion=
↵FailureMessage=
↵ ([0]Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.RuntimeCheckFailedException.StackTrace:)
↵ at Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.Internal.RuntimeChecks.Fail(String message)
↵ at Microsoft.PowerBI.DataMovement.GatewayMashupClient.MashupGatewayClientHost..ctor(IGatewayDiscoverer gatewayDiscoverer, GatewayAndUserInfo gatewayAndUserInfo, IEnumerable`1 dataSourceCredentials)
↵ at Microsoft.PowerBI.DataMovement.GatewayMashupClient.GatewayMashupConnectionFactory.CreateConnection(IGatewayDiscoverer gatewayDiscoverer, GatewayAndUserInfo gatewayAndUserInfo, IEnumerable`1 dataSourceCredentials, Guid clientActivityId, Guid rootActivityId, Guid activityId, ITelemetryService telemetryService, GatewaySpoolControlSetting gatewaySpoolControlSetting)
↵ at Microsoft.PowerBI.DataMovement.GatewayMashupClient.GatewayMashupConnectionFactory.<>c__DisplayClass0_0.<CreateConnection>b__0()
↵ at Microsoft.PowerBI.DataMovement.Pipeline.Common.Diagnostics.PipelineTelemetryService.ExecuteInActivity(PipelineActivityType pipelineActivityType, Action action)
↵ at Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.Internal.DiagnosticsContext.DiagnosticsContextExecutor.ExecuteInTopLevelActivity(PipelineActivityType pipelineActivityType, Action action)
↵ at Microsoft.PowerBI.DataMovement.GatewayMashupClient.GatewayMashupConnectionFactory.CreateConnection(IGatewayDiscoverer gatewayDiscoverer, GatewayAndUserInfo gatewayAndUserInfo, IEnumerable`1 dataSourceCredentials, Guid clientActivityId, Guid rootActivityId, Guid activityId, GatewaySpoolControlSetting gatewaySpoolControlSetting)
↵ at Microsoft.Azure.Connectors.Common.Mashup.Adapter.GatewayMashupQueryExecutor.CreateMashupConnection(HttpRequestMessage request, MashupConnectionStringBuilder builder) in D:\bt\969492\repo\src\source\common\Mashup\Adapter\GatewayMashupQueryExecutor.cs:line 86
↵ at Microsoft.Azure.Connectors.Mashup.Sql.SqlMashupQueryExecutor.CreateMashupConnection(HttpRequestMessage request, MashupConnectionStringBuilder builder) in D:\bt\969492\repo\src\source\Mashup\Sql\Adapter\SqlMashupQueryExecutor.cs:line 140
↵ at Microsoft.Azure.Connectors.Common.Mashup.Adapter.MashupQueryExecutor.<>c__DisplayClass13_2.<InvokeMashupAsync>b__0() in D:\bt\969492\repo\src\source\common\Mashup\Adapter\MashupQueryExecutor.cs:line 268
↵ at System.Threading.Tasks.Task`1.InnerInvoke()
↵ at System.Threading.Tasks.Task.Execute()
↵--- End of stack trace from previous location where exception was thrown ---
↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
↵ at Microsoft.Azure.Connectors.Common.Utilities.TaskExtensions.<WithCancellation>d__0.MoveNext() in D:\bt\969492\repo\src\source\common\Utilities\Extensions\TaskExtensions.cs:line 43
↵--- End of stack trace from previous location where exception was thrown ---
↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
↵ at Microsoft.Azure.Connectors.Common.Utilities.TaskExtensions.<WithCancellation>d__1`1.MoveNext() in D:\bt\969492\repo\src\source\common\Utilities\Extensions\TaskExtensions.cs:line 57
↵--- End of stack trace from previous location where exception was thrown ---
↵ at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
↵ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
↵ at Microsoft.Azure.Connectors.Common.Mashup.Adapter.MashupQueryExecutor.<InvokeMashupAsync>d__13.MoveNext() in D:\bt\969492\repo\src\source\common\Mashup\Adapter\MashupQueryExecutor.cs:line 268
↵ inner exception: Internal error: gatewayAndUserInfo
↵clientRequestId: b675ef21-40d3-4b48-acad-3abc1aee298a"
source: "sql-ne.azconn-ne.p.azurewebsites.net"
status: 502
message: "BadGateway"
source: "europe-001.azure-apim.net"

I can't tie this to a specific function within PowerApps and it doesn't appear to have any impact on the running app other than continually showing the red bar error at the top of the screen which is of great annoyance to users.

 

It seems to happen most when I have a lot of functions happening in one action but not always.

Sometimes the app will be fine for a while then start giving me the error again.

 

The data sources in the app are SQL tables through an on-premise gateway which is showing online and logging the same error on the server. Also the Office365 data source and the Office 365 Users data source.

 

After looking in the logs on the server for the gateway I find a corresponding error at the same time in the 'GatewyInfo#DateTime#.log':

[DM.GatewayCore] Db pool opening raw database connection to [Microsoft.Data.Mashup: <pi>Microsoft.Data.Mashup:TRUNCATED:[Basic] Encrypted Credential information omitted</pi>]

[DataMovement.PipeLine.GatewayDataAccess] Gateway couldn't decrypt the credential using the symmetric key.

Now I know all the credentials are set up correctly because all of the queries are executing and all of the data is being returned to the app so why would it do this every so often?

 

 

Does anyone have any suggestions?

 

 

 

Categories:
  • jonickes Profile Picture
    3 on at

    I'm receiving the same, also sporadic, but noticable on pages with more lookups. 

     

    An error occurred on the server. Server Response: Not a valid connector response. returning message as is: { "error": { "code": 502, "source": "msmanaged-na.azure-apim.net", "clientRequestId": "9273c748-7c9e-401d-90fd-c4c18fdece88", "message": "BadGateway", "innerError": { "status": 502, "message": "Unexpected Exception : [0]Microsoft.PowerBI.DataMovement.Pipeline.Diagnostics.RuntimeCheckFailedException: Internal error: gatewayAndUserInfo\r\n Template...

  • AtlantisFury Profile Picture
    60 on at

    I am having similar issues with one of my apps that is connected to Salesforce. The app loads with this error condition but is functional, I have tried re-authenticating the connector several times but it doesn't seem to fix the error.

    All of my end users are getting the same error message when the app is first loaded. If they close and re-open the app, the error does not re-appear until the session is ended and another begins.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard