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

Email arrives trigger - Predict failing

Hello,

 

I am having an issue with the Predict function within a Solutions flow. The Predict function always fails when triggered from a new email being received. When I manually resubmit the flow it works as it should so there shouldn't be an issue with my expressions etc but perhaps I am missing a step before the Predict function is queued.

 

Here is the start of the flow...

Screen Shot 2019-09-02 at 16.58.52.png

And here is the error....

Screen Shot 2019-09-02 at 16.58.33.png

 

Any ideas?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
kcg633755
Level: Powered On

Re: Email arrives trigger - Predict failing

Hi,

 

This didn't work either and furthermore stopped the manual trigger from working.

 

Here is the ouput of the failed test...

 

"statusCode": 400,
"headers": {
"Cache-Control": "no-cache",
"Set-Cookie": "ReqClientId=7c679919-def8-4acd-b5f3-4c0da3ba233b; expires=Tue, 03-Sep-2069 08:52:02 GMT; path=/; secure; HttpOnly,orgId=cebab21c-cfc9-4791-9017-c33c5721252b; expires=Tue, 03-Sep-2069 08:52:02 GMT; path=/; secure; HttpOnly",
"Server": "Microsoft-IIS/10.0",
"x-ms-service-request-id": "15b2c409-0993-48c1-a0cd-a07ca97c23e5",
"REQ_ID": "15b2c409-0993-48c1-a0cd-a07ca97c23e5,15b2c409-0993-48c1-a0cd-a07ca97c23e5",
"AuthActivityId": "8fa26832-d648-421b-8fb0-23310ece45dc",
"x-ms-ratelimit-burst-remaining-xrm-requests": "5999",
"x-ms-ratelimit-time-remaining-xrm-requests": "1,197.54",
"OData-Version": "4.0",
"Public": "OPTIONS,GET,HEAD,POST",
"X-Powered-By": "ARR/3.0,ASP.NET",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Date": "Tue, 03 Sep 2019 08:52:05 GMT",
"Content-Length": "3984",
"Allow": "OPTIONS,GET,HEAD,POST",
"Content-Type": "application/json; odata.metadata=minimal",
"Expires": "-1"
},
"body": {
"error": {
"code": "0x80040265",
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"InvalidPredictionInput\",\"message\":\"File content could not be parsed, could be that the mime type does not match the actual binary content\",\"properties\":{\"BackendErrorCode\":\"InvalidInferenceInput\",\"BackendHttpStatusCode\":\"BadRequest\"},\"innerErrors\":[{\"scope\":\"Record\",\"type\":\"Error\",\"code\":\"Unknown\",\"properties\":{\"MlIssueCode\":\"InvalidRecord\",\"MlIssueTarget\":\"single\"}}]}}",
"innererror": {
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"InvalidPredictionInput\",\"message\":\"File content could not be parsed, could be that the mime type does not match the actual binary content\",\"properties\":{\"BackendErrorCode\":\"InvalidInferenceInput\",\"BackendHttpStatusCode\":\"BadRequest\"},\"innerErrors\":[{\"scope\":\"Record\",\"type\":\"Error\",\"code\":\"Unknown\",\"properties\":{\"MlIssueCode\":\"InvalidRecord\",\"MlIssueTarget\":\"single\"}}]}}",
"type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
"stacktrace": " at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext, Dictionary`2 optionalParameters)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Execute(OrganizationRequest request, ExecutionContext executionContext)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.ExecuteOperation(CrmODataExecutionContext context, EdmOperation edmOperation, Dictionary`2 parameters, Dictionary`2 boundParameters)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.ProcessOperationRequest(String operationName, Dictionary`2 operationParameters, EntityReference entityReference, String boundEntityName, String boundEntityType)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.<>c__DisplayClass11_0.<PostBoundAction>b__0()\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\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.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.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.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.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
}

 

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: Email arrives trigger - Predict failing

Hi @kcg633755 

 

Check my video on how to do this https://www.youtube.com/watch?v=2vnKw-w9EUM

 

You need to use the expression function base64() to typecast your attachment content

 

"base64Encoded":"base64(AttachmentDynamicContent)"

 

where base64(AttachmentDynamicContent) is a function and AttachmentDynamicContent - is the dynamic content value for the Attachment Content

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

kcg633755
Level: Powered On

Re: Email arrives trigger - Predict failing

This doesn't seem to translate over to when an email arrives as the email might have multiple attachments, so it won't accept when adding the base64 expression.

 

It comes out as...

 

base64(@{items('Apply_to_each')?['ContentBytes']})
Dual Super User
Dual Super User

Re: Email arrives trigger - Predict failing

Hi @kcg633755 

 

since you are using a loop

 

use the following item()?['ContentBytes'] as an expression 

 

so expresison would be

 

base64(item()?['ContentBytes'])

Community Support Team
Community Support Team

Re: Email arrives trigger - Predict failing

Hi @kcg633755 ,

 

The expression should as below:

base64(items('Apply_to_each')?['contentBytes'])

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.

Highlighted
kcg633755
Level: Powered On

Re: Email arrives trigger - Predict failing

Hi,

 

This didn't work either and furthermore stopped the manual trigger from working.

 

Here is the ouput of the failed test...

 

"statusCode": 400,
"headers": {
"Cache-Control": "no-cache",
"Set-Cookie": "ReqClientId=7c679919-def8-4acd-b5f3-4c0da3ba233b; expires=Tue, 03-Sep-2069 08:52:02 GMT; path=/; secure; HttpOnly,orgId=cebab21c-cfc9-4791-9017-c33c5721252b; expires=Tue, 03-Sep-2069 08:52:02 GMT; path=/; secure; HttpOnly",
"Server": "Microsoft-IIS/10.0",
"x-ms-service-request-id": "15b2c409-0993-48c1-a0cd-a07ca97c23e5",
"REQ_ID": "15b2c409-0993-48c1-a0cd-a07ca97c23e5,15b2c409-0993-48c1-a0cd-a07ca97c23e5",
"AuthActivityId": "8fa26832-d648-421b-8fb0-23310ece45dc",
"x-ms-ratelimit-burst-remaining-xrm-requests": "5999",
"x-ms-ratelimit-time-remaining-xrm-requests": "1,197.54",
"OData-Version": "4.0",
"Public": "OPTIONS,GET,HEAD,POST",
"X-Powered-By": "ARR/3.0,ASP.NET",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"Date": "Tue, 03 Sep 2019 08:52:05 GMT",
"Content-Length": "3984",
"Allow": "OPTIONS,GET,HEAD,POST",
"Content-Type": "application/json; odata.metadata=minimal",
"Expires": "-1"
},
"body": {
"error": {
"code": "0x80040265",
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"InvalidPredictionInput\",\"message\":\"File content could not be parsed, could be that the mime type does not match the actual binary content\",\"properties\":{\"BackendErrorCode\":\"InvalidInferenceInput\",\"BackendHttpStatusCode\":\"BadRequest\"},\"innerErrors\":[{\"scope\":\"Record\",\"type\":\"Error\",\"code\":\"Unknown\",\"properties\":{\"MlIssueCode\":\"InvalidRecord\",\"MlIssueTarget\":\"single\"}}]}}",
"innererror": {
"message": "{\"operationStatus\":\"Error\",\"error\":{\"type\":\"Error\",\"code\":\"InvalidPredictionInput\",\"message\":\"File content could not be parsed, could be that the mime type does not match the actual binary content\",\"properties\":{\"BackendErrorCode\":\"InvalidInferenceInput\",\"BackendHttpStatusCode\":\"BadRequest\"},\"innerErrors\":[{\"scope\":\"Record\",\"type\":\"Error\",\"code\":\"Unknown\",\"properties\":{\"MlIssueCode\":\"InvalidRecord\",\"MlIssueTarget\":\"single\"}}]}}",
"type": "System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
"stacktrace": " at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext, Dictionary`2 optionalParameters)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Execute(OrganizationRequest request, ExecutionContext executionContext)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.ExecuteOperation(CrmODataExecutionContext context, EdmOperation edmOperation, Dictionary`2 parameters, Dictionary`2 boundParameters)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.ProcessOperationRequest(String operationName, Dictionary`2 operationParameters, EntityReference entityReference, String boundEntityName, String boundEntityType)\r\n at Microsoft.Crm.Extensibility.OData.ActionController.<>c__DisplayClass11_0.<PostBoundAction>b__0()\r\n at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\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.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.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.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.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
}
}
}

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,902)