Contents

Troubleshooting DVT script for service model - Dynamics 365 Finance & Operations Tier 1 Upgrade

While doing upgrade to the latest version Dynamics 365 Finance & Operations on tier 1 environment, you might got some errors related to DVT auto scripts.

1. DVT script for service model: AOSService on machine

An error at step 72

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<Step>
   <ID>72</ID>
   <RunbookID>498de9aee46e403e9dcd97b40166775e</RunbookID>
   <PackageId>dd4119e4331248d5a6ba9b987eef440d</PackageId>
   <PackageType>PlatAppBinaryHotfixPackage</PackageType>
   <CompletedManually>false</CompletedManually>
   <Description>DVT script for service model: AOSService on machine: </Description>
   <MachineName></MachineName>
   <ServiceModelName>AOSService</ServiceModelName>
   <ScriptToExecute>
      <FileName>AutoRunDVT.ps1</FileName>
      <Automated>true</Automated>
      <Description>Run the AOS DVTs</Description>
      <RetryCount>1</RetryCount>
      <TimeoutValue>1</TimeoutValue>
      <InvokeWithPowershellProcess>false</InvokeWithPowershellProcess>
      <DoNotAutoResume>false</DoNotAutoResume>
      <DynamicStepDefinition />
   </ScriptToExecute>
   <StepType>DVT</StepType>
   <StepConcurrency>Multiple</StepConcurrency>
   <ScriptExecutionOutput />
</Step>

Event log error details

Failure
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. —> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

Solution

You need to abort the current process in LCS because this option will only show for environments in the Deployed state, then do “Rotate the SSL certificates”

  • On the Environment details page, click Maintain > Rotate secrets.
  • Select Rotate the SSL certificates and confirm that you want to perform this action.

/2021-12-21-troubleshooting-dvt-script-for-service-model/rorate-ssl.png
rorate-ssl

2. Step 73 - DVT script for service model: MROneBox on machine

2.1 The error from runbook

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<Step>
   <ID>73</ID>
   <RunbookID>498de9aee46e403e9dcd97b40166775e</RunbookID>
   <PackageId>dd4119e4331248d5a6ba9b987eef440d</PackageId>
   <PackageType>PlatAppBinaryHotfixPackage</PackageType>
   <CompletedManually>false</CompletedManually>
   <Description>DVT script for service model: MROneBox on machine: </Description>
   <MachineName></MachineName>
   <ServiceModelName>MROneBox</ServiceModelName>
   <ScriptToExecute>
      <FileName>AutoRunDVT.ps1</FileName>
      <Automated>true</Automated>
      <Description>Run the AOS DVTs</Description>
      <RetryCount>1</RetryCount>
      <TimeoutValue>1</TimeoutValue>
      <InvokeWithPowershellProcess>false</InvokeWithPowershellProcess>
      <DoNotAutoResume>false</DoNotAutoResume>
      <DynamicStepDefinition />
   </ScriptToExecute>
   <StepType>DVT</StepType>
   <StepConcurrency>Multiple</StepConcurrency>
   <ScriptExecutionOutput />
</Step>

2.2 Event log error details

Failure
Exception : System.Management.Automation.RemoteException: An error was encountered while updating the Financial Reporting components. TargetObject : An error was encountered while updating the Financial Reporting components.

2.3 Solution

To resolve this, we will need to reset financial reporting data mart, following the steps

  • Stops AX services

    • World wide web publishing service (on all Application Object Servers [AOS] computers)
    • Batch Management Service (on non-private AOS computers only)
    • Management Reporter 2012 Process Service (on Business intelligence [BI] computers only)
Note
We can use command line too NET STOP "MR2012ProcessService"
  • Open PowerShell and execute the following script, this will execute reset datamart
1
2
3
cd K:\MROneBox\MRInstallDirectory\Server\MRDeploy\
Import-Module .\MRDeploy.psd1
Reset-DatamartIntegration -Reason OTHER -ReasonDetail "<reason for resetting>" -SkipMRTableReset
Note
To ensure that old data isn’t inserted, a data mart reset can be started only after existing tasks are completed. If you try to reset the data mart before all tasks are completed, you might receive a message such as, “The data mart reset was unable to be processed because of an active task. Please try again later.”
  • After reset datamart, we need to execute the step 73 again, find the latest deployable package applied to the environment. It will be under folder <ServiceVolue>:\DeployablePackages\<PackageGUID>\MROneBox\Scripts\Update

Execute AutoRunDVT.ps1 in Powershell

1
.\AutoRunDVT.ps1

If it can be executed without error, you can go ahead and resume the deployment in LCS.

If there are still errors, we need an extra step

  • Find the DVT execution script: <ServiceVolue>:\DeployablePackages\<PackageGUID>\MROneBox\scripts\Update\AutoRunDVT.ps1
  • Make a copy of the file
  • Clear all contents AutoRunDVT.ps1 and save
  • Resume the deployment from LCS.