The plug-in execution failed because the Sandbox Worker process crashed. This is typically due to an error in the plug-in code – Dataverse / Dynamics 365


Recently we got the below exception for one of our plugins.

Message: The plug-in execution failed because the Sandbox Worker process crashed. This is typically due to an error in the plug-in code. Please refer to this document: https://go.microsoft.com/fwlink/?linkid=2189390
Microsoft.Xrm.RemotePlugin.Grpc.ExceptionHandlers.SandboxFabricWorkerCommunicationException: Error communicating with SandboxFabric Worker —> Grpc.Core.RpcException: Status(StatusCode=”DeadlineExceeded”, Detail=”Deadline Exceeded”

If we refer to Microsoft Documentation below seems to be the cause of the issue in our case.

In our scenario, we had a Plugin that was Asynchronous and it was triggered on the Post Update of Work Order Service task. The plugin will fetch all the attachments (to notes associated with inspection attachments > inspection response > work order service task). There were many Service Tasks having more than 20 attachments exceeding 100 mb size total.

We were doing bulk updates which triggered the plugin creating too many requests eventually leading to that error.

Get more details – Error “Sandbox Worker Process Crashed”

Also, check – https://cloudblogs.microsoft.com/dynamics365/it/2017/02/20/microsoft-dynamics-365-online-asynchronous-service-quotas/

Hope it helps..

Advertisements

Fixed – System.InvalidOperationException: Message size exceeded when attempting to send response to sandbox. Message Size 123 Mb. Max Allowed 128974848 Mb (Dataverse / Dynamics 365 )


Recently we got the below exception for one of our plugins
Message: System.InvalidOperationException: Message size exceeded when attempting to send response to sandbox. Message Size 123 Mb. Max Allowed 128974848 Mb.

Below is the code where we were getting the error. We were retrieving the notes records associated with the inspection response/inspection attachments. (Dynamics 365 Field Service)

And if we had a total of all attachments to it more than 100 mb it was failing.

Below is the test Work Order Service Task record for which we were getting the error.

There were a couple of other attachments also to it making a total of more than 100 Mb.

Here to fix the error instead of fetching all the note details at once and then processing the notes attachments, we updated our logic to process the notes attachments one by one.

Hope it helps..

Advertisements

How to – Create an Automated low-code plug-in (Dataverse) (experimental)


In the previous post, where we installed the Dataverse Accelerator app and saw how to write basic low-code Instant Plugins.

Here we’d look at the Automated low-code Plugins.

Select the New Plugin option in the Dataverse Accelerator app to create Automate Plugins.

We get the option to select the table, the event, define the behavior of the plugin using Power FX, specify pre or post-operation, and the solution as shown below.

To keep it simple, we have created a plugin on pre-operation that checks for null, the email address field in the Contact record on Create, and if blank throws an error.

On trying to create a contact record without an email address, we get the exception as specified in the plugin.

That’s all we are done with our plugin.

Now interestingly if we check our solution specified, we will not find our plugin there. We need to add them to the solution manually right now, here we need to look for FxExpression.

Read more about it here – https://debajmecrm.com/how-to-write-plugins-in-dataverse-using-low-code-powerfx-functions/

And all the details here

Hope it helps..

Advertisements

How to – Create an Instant low-code plug-in (Dataverse) (experimental)


Low-code plug-in is a new experimental feature released by Microsoft, for early adopters, not meant to be used in production. As per Microsoft, “the experimental features can change radically or completely disappear at any time“.

There are 2 types of low-code plug-ins we can write – Instant and Automated.

Instant plug-ins are triggered manually and support parameters, whereas automated plug-in as the name suggests, runs when a particular event (create, update, or delete) occurs on a table and they do not support parameters.

As a prerequisite, we need to first install the Dataverse Accelerator

We can install it from Admin Center >> Resources >> Dynamics 365 Apps

Or from the App Source, look for Dataverse Accelerator and click Get in now.

https://appsource.microsoft.com/en-us/product/dynamics-365/microsoftpowercatarch.dataversekit1?exp=kyyw

Specify the Environment to start the installation. (Should take around 5 minutes)

Open the Dataverse Accelerator App.

Click on + New plugin for the Instant Plugins

Provide the display name and the description for the plugin, and also select the appropriate solution.

We can specify optional Input and Output parameters along with the Expression that uses Power FX formulas to define the logic for the plugin.

Our sample plugin takes City as the Input Parameter and returns the total number of contact records having that same city.

Save the plugin and click on Test.

Provide the value for the input parameter and click on Run.

We can see the status as Success and the output parameter Result having a value of 4.

This completes our plugin.

Now to use it, click on the Integrate tab.

The tab provide us the required details.

We can copy the Power FX expression and use it inside the Canvas App.

We get the output as expected.

Below we are calling it from within the Power Automate Flow from a Perform an unbound action

The result –

Get more details and Check out the known limitations

Hope it helps..

Advertisements

Plugin registration profile record not getting created – Dataverse / Dynamics 365


Recently while trying to debug a plugin with Persist to Entity mode on the update step, we didn’t find any profile record getting created.

One option is to try to reinstall the profiler. This could happen when we are using a different version of the plugin registration tool and it has the Profiler already installed/configured from the other version of the tool.

If that doesn’t help, then opt for Exception mode, that has always worked.

Hope it helps..

Advertisements

The plug-in execution failed because no Sandbox Hosts are currently available. Please check that you have a Sandbox server configured and that it is running.


Hi,

We had our plugins registered in Sandbox mode (for development we were using on premise and were deploying it on online environment) and the Microsoft Dynamics CRM Sandbox Processing Service was not running.

Starting the service resolved the issue.

Hope it helps.