Retail servicing data is not present in the RetailServer web.config when running Retail Retargeting tool

Thi is an issyue we have noticed on especially new environments that we have refreshed with a database from an existing Retail Enable environment. After refreshing the database we need to run the retargeting tool to make sure that all settings are corrected.

When the tool is run it fails at step 3 and when we look in the Step3RetargetRetailServer-logfile we find this:

12/6/2017 9:35:52 AM:     – Trying to get information of the website – AOSService …
Unexpected error. Microsoft.Dynamics.ApplicationPlatform.Environment.Settings.ConfigurationKeyNotFoundException: No setting keys found for prefix ‘CertificateHandler’.
    at Microsoft.Dynamics.ApplicationPlatform.Environment.Settings.BaseConfigSetting.GetSettingsForPrefix(String prefix)
    at ConfigEncryptor.Program.Main(String[] args).
12/6/2017 9:35:52 AM:
PSMessageDetails      :
Exception             : System.Management.Automation.RuntimeException: Retail servicing data is not present in the
                         RetailServer web.config, please contact DSE team.
TargetObject          : Retail servicing data is not present in the RetailServer web.config, please contact DSE team.
CategoryInfo          : OperationStopped: (Retail servicin…ntact DSE team.:String) [], RuntimeException
FullyQualifiedErrorId : Retail servicing data is not present in the RetailServer web.config, please contact DSE team.
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, F:\DeployablePackages\a2f41617-591e-45c9-bce4-1934c1b17ca6\RetailServer\scrip
                         ts\RetargetRetailServer.ps1: line 299
                         at <ScriptBlock>, <No file>: line 3
                         at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
12/6/2017 9:35:52 AM: Executed:
F:\DeployablePackages\a2f41617-591e-45c9-bce4-1934c1b17ca6\RetailServer\scripts\RetargetRetailServer.ps1
Exiting with error code .

This error is due to missing information in the Web.Config file for Retail. Fortunately there is a fairly easy fix… there is a script in the Retail Retargeting tool called Update-RetailServicingInformation.ps1 which populates the web.config file with the correct information. The parameters you will need to provide is the database name which you can find in SQL Server Management Studio and the SQL Server name. The server name for OneBox Environments is Localhost. For Tie-2 and up you will need to provide the Azure SQL name which you can find in LCS, don´t forget to add database.windows.net to make it a FQDN

/Johan

Azure SQL SqlPackage error

Today I tried to do a restore of database to an Azure DB in a Dynamics 365 for Operations environment. When I ran SQLPackage.exe I got the following error:

‘Unable to connect to master or target server ‘AxDB_New’. You must have a user with the same password in master or target server ‘AxDB_New’

The issue here is that the version of SQL Management Studio that is provided in the Azure VM is version 16 and Azure SQL requires version 17… with that background I am not convinced that the error message is totally relevant…

The solution is to upgrade Management Studio to the latest Version.

image

/Johan

Providing a clean database in upgrade mode for AX 2012

When we upgrade to AX 2012 the destination database needs to be in “upgrade mode” othewise the upgrade checklist it not triggered correctly. This can be done in one of two ways… either you check “Register this database for Upgrade” when you set up the AOS… this implies that you actually set up a new AOS. If you do not want to do that you can also do this:

1. Start SQL Management Studio and run this script:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SETUPVERSIONPROC] AS SELECT ‘6.0.947.0’
GO
DELETE FROM SysSetupLog
WHERE NAME = ‘SysCheckList_Setup’
OR NAME LIKE ‘SysCheckList_Up%’

Links
https://blogs.msdn.microsoft.com/axsupport/2012/11/16/ax2012-upgrades-setting-a-clean-ax2012-database-to-start-with-the-upgrade-check-list-and-not-the-initialization-check-list/

Running out of space on a Dynamics 365 for Operations Vm in Azure

When setting up environments for Dynamics 365 for Operation in Azure you are using a tool called LCS (Life Cycle Services). This allows you to set up VMs in different sizes and once the are up it does not allow you to change them. When using the VMs they tend to, sooner or later, fill up and run out of disk space. There are two main ways to fix this… clean up or make the disk bigger (this will be handled in another article which I will link here). In this article we will look at things you can clean up.

1. Remove files in C:\TEMP
Note: Do NOT remove the C:\DIXF folder… that will make DIXF fail. If you remove it, by mistake, you will have to recreate it and manually set permissions on it.

2. You can also clean out files in C:\MonAgentData\SingleAgent\Tables\. To do this you first have to stop the Monitoring Agent Service.

Edited 2018-05-03

There is also a job that cleans out the DeployablePackages every 30 days. This job can be tweeked to run more often by adding a registry key in HKLM:\SOFTWARE\Microsoft\Dynamics\Deployment called CutoffDaysForCleanup and set it to maximum number of days to keep files

Bye for today

Links
https://devserra.wordpress.com/2016/03/03/ax7-release-hd-space-on-your-ctp8-vm/

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/deployment/deployable-package-troubleshooting

http://www.alexondax.com/search?q=DeployablePackages

Detailed Version Information in LCS

When contacting Microsoft Support about Dynamics 365 for Operations they often ask you for the version information for an environment. We have been having an issue with seeing it for our Cloud Hosted Environments… it simply was not there:

SNAGHTML9e3aa91

I finally found a way to fix this and it is Very Simple (onece you know it)

Go to the adress bar in your browser… At here end of your URL you will find:

&IsDiagnosticsEnabledEnvironment=false

change it to:

&IsDiagnosticsEnabledEnvironment=true

and presto!!!

SNAGHTML9e78d61

/Johan

Backup Azure SQL database

In working with Dynamics 365 for operations one is exposed to Azure SQL. Azur SAL works a bit differently than the “regular old” SQL and one of those areas is backup.

To backup a database in Azure SQL I use one of two methods:

1. Create a copy of the table in the same SQL Server

CREATE DATABASE [sourcedb] AS COPY OF [destinationdb]

This operation is performed asynchronously and you will need to verify that the job is done before you continue. This can be done with this command:

SELECT * FROM sys.dm_database_copies

Note: you need to have selected the master database when you run the backup. Otherwise you will not be able get an exclusive lock on the database and you will get the following error: Msg 42019

To find what is locking the database you can use:

SELECT * FROM sys.dm_exec_sessions
KILL [session ID]

2. Use SqlPackage to create an export in the form of a BacPac file

cd C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin
SqlPackage.exe /a:export /ssn:<server>.database.windows.net /sdn:<SourceDB> /tf:<filedestination> /p:CommandTimeout=1200 /p:VerifyFullTextDocumentTypesSupported=false /sp:<sql password> /su:<sql user>

/Johan

Error importing Electronic Reporting Configurations

Hi…

Today we are looking at an issue that one of my colleagues had. This is actually an Application issue but I am writing it up for future reference.

When we are importing Electronic Reporting configuration in Dynamics 365 for Operation we get the following error:

clip_image001

Since it is a bit intermittent and works for some configurations we have suspected a timeout… we were on the right track… When speaking to Microsoft Support we got the tip to change a parameter in the configuration for Electronic Reporting to allow more multiple parallel threads for loading data:

image

Go to Organization administration – Workspaces – Electronic reporting – Electronic Reporting parameters and change Number of parallel threads to load data to 15 (the default is 5)

BR

Johan

Error in Environment Reprovisioning tool

I have been working with an upgrade of Dynamics 365 for Operations now for a while and found an issue when it comes to Environment Reprovisioning tool, also known as Retail Retargeting Tool. This is a tool used to fix the retail conponents in an environment after you have done a database copy to the environment from another environment. We did this as part of the upgrade to Platfor Update 10.

When we ran the tool from the command prompt in the environemnt we gor the following error:

The step completed
Executing step: 3
GlobalUpdate script for service model: RetailServer on machine: localhost
Run RetargetRetailServer.ps1
RetargetRetailServer.ps1 failed.
The step failed
The step: 3 is in failed state, you can use rerunstep command to debug the step explicitly
at Microsoft.Dynamics.AX.AXUpdateInstallerBase.RunbookExecutor.executeRunbookStepList(RunbookData runbookData, List`1 runbookStepList, String updatePackageFilePath, Boolean silent, String stepID, ExecuteStepMode executeStepMode, Boolean versionCheck, Boolean restore, Parameters parameters)
at Microsoft.Dynamics.AX.AXUpdateInstallerBase.RunbookExecutor.executeRunbook(RunbookData runbookData, String updatePackageFilePath, Boolean silent, String stepID, ExecuteStepMode executeStepMode, Boolean versionCheck, Boolean restore, Parameters parameters)
at Microsoft.Dynamics.AX.AXUpdateInstallerBase.AXUpdateInstallerBase.execute(String runbookID, Boolean silent, String updatePackageFilePath, IRunbookExecutor runbookExecutor, Boolean versionCheck, Boolean restore)
at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.InstallUpdate(String[] args)
at Microsoft.Dynamics.AX.AXUpdateInstaller.Program.Main(String[] args)

So this error was not that obvious to me… So I took a look at the loggs for the Deployable package which are located in the RunbookWorkingFolder (located in the folder where you extracted the package). There I found this:

Exception : System.Management.Automation.RuntimeException: The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin
TargetObject : The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin

This made me think… The older environments always had an account called axlocaladmin but the newer ones does not. After some digging around in the script called RetargetRetailServer.ps1 I found this (on line 302) :

if($env:UserName -ne 'axlocaladmin')
{
    $errorMessage = "The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin"
    Log-TimedMessage $errorMessage
    throw $errorMessage
}

I simply changed it to:

if($env:UserName -ne 'adminXXXXXXXXXX')
{
    $errorMessage = "The servicing data of this box has not been migrated yet, please rerun this tool with axlocaladmin"
    Log-TimedMessage $errorMessage
    throw $errorMessage
    
}

where adminXXXXXXXXXX is the account name for my user and the i re-ran:

AXUpdateInstaller.exe execute -runbookid=env-reprovision -rerunstep=3

And presto… it worked 🙂

Note that this is the reprovisioning tool from 8/30/2017, I have not looked at any other verisons.

/Johan

Issues after Database copy

Yesterday we did a database refresh between two of our Non-Production OneBox environments an this morning I got an email. The users where having problem viewing invoices in All Sales Orders. The error they got looked like this:

“Something went wrong while generating the report. Please try again”

That was not extremely helpful so I started looking around and found information on how to get a detailed log:

1. Click on Environment monitoring.
2. Click on Raw logs
3. In the query name field, select “All events for activity”
4. Copy 78ca1c74-3c56-4f6b-8c18-a4034876780d in the activity ID
5. Click on shows options and set Row limit to 5000.
6. Click on search.
7. Scroll down towards the end to see exception message.

And that got me (not very useful):

at [aoskernel.dll]Microsoft.Dynamics.Ax.MSIL.Interop.GetManagedCallStack(basic_string<wchar_t\,std::char_traits\,std::allocator >* ) at [aoskernel.dll]Microsoft.Dynamics.Ax.Services.AOSAppDomainHelper.callGetManagedCallStack(basic_string<wchar_t\,std::char_traits\,std::allocator >* ) at callGetManagedCallStack(basic_string<wchar_t\,std::char_traits\,std::allocator >* ) at cqlClass.callEx(cqlClass* , Char* , interpret* ) at cqlClass.callEx(cqlClass* , Char* , interpret* ) at [aoskernel.dll]Microsoft.Dynamics.Ax.MSIL.cqlClassIL.Call(IntPtr c, String methodName, Object[] parameters, Type[] types, Object[] varargs, Type[] varargsTypes) at [Microsoft.Dynamics.AX.Server.Core.dll]Microsoft.Dynamics.Ax.Xpp.XppObjectBase.Call(String methodName, Object[] parameters, Type[] types, Object[] varargs) at [Microsoft.Dynamics.AX.Xpp.Support.dll]Dynamics.AX.Application.xInfo.add(Exception exception1, String text1, String text2) at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.`add(Exception _exception, String _txt, String _helpUrl, XppObjectBase _sysInfoAction, Boolean buildprefix, String _label, Boolean @_helpUrl_IsDefaultSet, Boolean @_sysInfoAction_IsDefaultSet, Boolean @buildprefix_IsDefaultSet, Boolean @_label_IsDefaultSet) in xppSource://Source/ApplicationPlatform\AxClass_Info.xpp:line 335 at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.InfoCoCHelper.`add(Info instance, Exception arg0, String arg1, String arg2, XppObjectBase arg3, Boolean arg4, String arg5, Boolean , Boolean , Boolean , Boolean ) at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.add(Exception _exception, String _txt, String _helpUrl, XppObjectBase _sysInfoAction, Boolean buildprefix, String _label, Boolean @_helpUrl_IsDefaultSet, Boolean @_sysInfoAction_IsDefaultSet, Boolean @buildprefix_IsDefaultSet, Boolean @_label_IsDefaultSet) at [Dynamics.AX.ApplicationPlatform.dll]Dynamics.AX.Application.Info.add(Exception _exception, String _txt) at [Dynamics.AX.ApplicationFoundation.dll]Dynamics.AX.Application.SrsReportViewerControl.`displayErrorMessage(String message) in xppSource://Source/ApplicationFoundation\AxClass_SrsReportViewerControl.xpp:line 870 at [Dynamics.AX.ApplicationFoundation.dll]Dynamics.AX.Application.SrsReportViewerControl.SrsReportViewerControlCoCHelper.`displayErrorMessage(SrsReportViewerControl instance, String arg0) at [Dynamics.AX.ApplicationFoundation.dll]Dynamics.AX.Application.SrsReportViewerControl.displayErrorMessage(String message) at SrsReportViewerControl::displayErrorMessage(Object , Object[] , Boolean& ) at [Microsoft.Dynamics.AX.Xpp.Support.dll]Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters) at callILClassMethod(interpret* ip, Char* method, UInt32 chdl, cqlClass* c) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionHandler.InvokeCommand(CommandInteraction interaction, CommandCallbackInteraction& result) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionHandler.HandleCommandInteraction(CommandInteraction interaction, List`1 outboundInteractions) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionHandler.HandleInteractions(IInteractionChannel interactionChannel) at [aoskernel.dll]Microsoft.Dynamics.Client.ServerForm.Interactions.InteractionManager.ProcessMessages(Object stateinfo) at [mscorlib.dll]System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at [mscorlib.dll]System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at [mscorlib.dll]System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at [mscorlib.dll]System.Threading.ThreadPoolWorkQueue.Dispatch()</wchar_t\,std::char_traits</wchar_t\,std::char_traits</wchar_t\,std::char_traits

So I started to look around a little and found the System administration – Setup – Server Configuration and noticed that there were 2 servers… in a OneBox Environment…

                     SNAGHTMLa4c1c3d

The migration server was still there and it seemed that it was trying to have that one generate the report. When I removed the extra server it started working

/Johan