cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SimonMeadows
Level 8

An error occurred on the server.

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?

 

 

 

2 REPLIES 2
jonickes
Level: Powered On

Re: An error occurred on the server.

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
Level: Powered On

Re: An error occurred on the server.

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.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,374)