none
Web-Http Adapter still doesn't return Error Description for Internal Server Error (500)

    Question

  • Hi All,

    I know there's a fix in BizTalk 2016 CU1 for WebHttp adapter that let's it pick 500 Internal Server Errors now and it does work but what still seems to be missing is the Error Description, in other errors in the 400 range, the error description returned by the Api are shown when message is suspended on the send port but in case of 500 it's like this only.

    System.Net.WebException: (500) Internal Server Error
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)

    Even though in Fiddler I can see that the Api (CRM Web Api in this case) has returned the error description like it does in case of 400 range of errors but Adapter doesn't seem to pick and display that with Suspended instance (neither in event log). Above exception is very generic and doesn't tell why the issue actually happened and we can't run Fiddler on our Production box to see what the issue actually was. Anyone else encountered this issue? Any possible resolutions for this? I am copying full fiddler traces of response below for above 500 error.

    HTTP/1.1 500 Internal Server Error
    Cache-Control: no-cache
    Pragma: no-cache
    Content-Type: application/json; odata.metadata=minimal
    Expires: -1
    Server: Microsoft-IIS/8.5
    REQ_ID: 3e219909-135c-41be-a2d2-9a6a9ab51bca
    OData-Version: 4.0
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Date: Wed, 23 Aug 2017 10:19:39 GMT
    Content-Length: 3193
    Set-Cookie: crmf5cookie=!1Gx5uwtUCR3upPbO/8BTxBu52Tf9Z/KUeTpObsxKcIKU6EOcpirKhobDx8OY2zQ133j5j05WrSta8HA=;secure; path=/
    Strict-Transport-Security: max-age=31536000; includeSubDomains

    {
      "error":{
        "code":"","message":"A record that has the attribute values Alt Key Contract Type Source Record Id already exists. The entity key AltKeyContractTypeSourceRecordid_key requires that this set of attributes contains unique values. Select unique values and try again.","innererror":{
          "message":"A record that has the attribute values Alt Key Contract Type Source Record Id already exists. The entity key AltKeyContractTypeSourceRecordid_key requires that this set of attributes contains unique values. Select unique values and try again.","type":"System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]","stacktrace":"   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Create(Entity entity)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)\r\n   at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String entitySetName, EdmEntityObject entityObject)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
        }
      }
    }


    Wednesday, August 23, 2017 1:03 PM

All replies

  • See https://cdijkgraaf.wordpress.com/2016/08/12/biztalk-2013-r2-known-bugs-issues-quirks/. In that article Coen says it was fixed in CU5 for BizTalk 2013 R2 .
    • Proposed as answer by Mark Brimble Friday, August 25, 2017 9:01 PM
    Friday, August 25, 2017 9:01 PM
  • That seems to be for not catching the 500 error, which I know is fixed also in BizTalk 2016 CU1 but my question is about description of the error.
    Friday, August 25, 2017 10:49 PM
  • Oh well it seems that you are trying to insert a duplicate value into CRM.
    Saturday, August 26, 2017 8:14 PM
  • I know but that description is not part of the suspended message
    Saturday, August 26, 2017 8:24 PM
  • There are no resolutions for this sorry. Upgrade to CU5.
    Saturday, August 26, 2017 8:27 PM
  • Hi Syed,

    I am facing a similar error as well. Did you manage to get the description from the error message. 

    Errors other than 500 are returned ok . But 500 still shows Internal error and no details. 2013R2 CU5


    -Ujjwal


    • Edited by ujjwalDev Monday, March 26, 2018 7:12 PM added version details
    Monday, March 26, 2018 7:02 PM
  • Unfortunately no Ujjwal. Sorry.

    -Syed

    Monday, March 26, 2018 8:46 PM