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/

Activating Dynamincs AX 2012 VMs deployed to Azure from LCS

Our company has retired all of our lab hosts which we used to have internally which means thet we need to have our lab servers on Microsoft Azure. To install the servers we use LCS (Lice Cycle Services) which deploys a VM in our Azure Subscription. The problem is that the VM is not activated, which on an internal server would require a product key and a Windows Server License… When running VMs internally we used to handle this by rearming the VMs 3 times which gives us a total of 180 days and then set up a new one which was a little hassle but it worked. But since we now have deployed VMs on Azure there is actually a license included in the Azure VM which means that there is no need to run a server which is not activated. Here is a short description on how to activate the AX VM…

  1. Install the new VM on Microsoft Azure using LCS
  2. Log into the the server using RDP (the logon info is in LCS)
  3. Start an elevated command prompt
  4. Find the edition of the VM by running this command:

    DISM /online /Get-CurrentEdition

    We get: Current Edition : ServerDatacenterEval

  5. Find out which edition you can upgrade to by running:

    DISM /online /Get-TargetEditions

    We get: Target Edition : ServerDatacenter

    This means that you can upgrade from the evaluation edition of datacenter edition to the full version of datacenter edition. Now we need a license key… Microsoft uses Automatic Virtual Machine Activation to license the VMs in Azure… This means that if the host is activated (which it hopefully is Smile ) the guest gets activated but to use this feature the guest VM still need a product key. The keys are available on Technet.

  6. Use the correct key to activate the VM by running this:

    DISM /online /Set-Edition:ServerDatacenter /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEULA

  7. Restart the VM and verify that is is not using Evaluation Edition anymore

    image

That’s all for today

Links:

https://technet.microsoft.com/en-us/library/dn303421.aspx

Issues with Retail Layout designer

One of my colleagues had an issue accessing the Screen Layout designer in the AX Client and I was a bit confused… it worked for me… This turned out to be two separate issues.

image    image

The first one was that he and I was logged into two different AOSes and the Retail Headquarter was not installed on the one he was logged on to… simple enough to fix… I simply installed it. The Retail Headquarter component includes some DLLS that are required. If you want to be able to run the Retail Layout Designer on a  client or terminal server you will need to install the retail components on the client/terminal server as well.

When we installed the Headquarter components we unfortunately missed the fact the we “probably should” install Expression Blend Sad smile (note to self… read all the instructions)

image

When we tried to start the Designer it crashed with this error.

image

I found information on this issue on LCS Issue Search (Link below). The trick is to install Expression Blend Dev Kit for .NET and then copy Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll from “C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries” to “C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin”

When these issues was fixed and my colleague tried to start the Button Grid Layout he gets this error:

SNAGHTML54766cd

Normally the AX AOS Service user is used to access the AX database but in some cases the individual user needs to have specific access… below is a link to an article that describes steps involved

 

Links
https://fix.lcs.dynamics.com/Issue/Solution/1223064?bugId=3725829&qc=dd5219a830d7a93c687ff03083b2970a6ae1775a018daa69b8be820ab77ae101

http://daxdude.blogspot.se/2013/02/ax-issue-method-start-in-com-object-of.html

Email errors in AX 2012 R2

One of my customers have migrated to new servers for their AOSes, these are brand new Windoews Server 2012 R2 servers… nice. We hade one issue though… When trying to send emails using batch from a batch jog we got the following error:

Microsoft.Dynamics.Ax.Xpp.ClrErrorException: Exception of type ‘Microsoft.Dynamics.Ax.Xpp.ClrErrorException’ was thrown.

   at Microsoft.Dynamics.Ax.Xpp.CLRInterop.staticInvoke(String typeName, String methodName, Object[] parameters, Type type)

   at Dynamics.Ax.Application.WinAPIServer.cryptUnProtectData(Object[] _encryptedDataBlob) in WinAPIServer.cryptUnProtectData.xpp:line 39

   at Dynamics.Ax.Application.SysEmailParameters.password() in SysEmailParameters.password.xpp:line 18

   at Dynamics.Ax.Application.SysEmailDistributor.Processemails(Guid _emailProcessorId) in SysEmailDistributor.processEmails.xpp:line 39

   at Dynamics.Ax.Application.SysEmailDistributor.Run() in SysEmailDistributor.run.xpp:line 78

   at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54

   at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13

   at BatchRun::runJobStatic(Object[] )

   at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

   at BatchIL.taskThreadEntry(Object threadArg)

It took me some time to figure it out… Apparently the password for the SMTP account is saved in the AX database, but using an encryption key from the computer which saved it (a.k.a. the server that was retired) so when moving to the new server it was not able to read it. To fix it I simply entered the password again from the new server and Presto!

/JP

Error when syncing DataMart – Invalid column name ‘PARTITION’. Invalid column name ‘Key_’.

Todays issue is a problem with integrating Management Reporter CU 15 with AX 2012 R3. When doing the initial integration we got this error:

Invalid column name ‘PARTITION’.
Invalid column name ‘Key_’.

and the integration never finished. After doing some research online I found someone with this issue and the recommendation was to downgrade to Management Reporter CU13. When doing so we bumped into an error in CU 13 causing deadlocks in SQL. I called Microsoft support and got the recommendation to once again upgrade to CU15.

Here is a good place to insert some history:

The customer upgraded from AX 2012 Feature Pack directly to AX 2012 R3. Before upgrading from AX 2012 Feature Release to AX 2012 R3 we had installed MR CU13. In AX 2012 R2 Microsoft introduced a feature called PARTITION. This is used to be able to host AX in a multi tenant environment with isolated customers.

When installing Management Reporter (CU13 and Later) and integrating it to AX it creates three views in the database.

image

When we upgraded directly from AX 2012 Feature Release directly to AX 2012 R3 these views where migrated to R3 and when we installed CU15 these views were never updated (the PARTITION column was missing), Management Reporter just verified that they were there and thought all was fine.

  1. Resolution:
    Remove the integration
  2. Remove the three views
  3. Recreate the integration
  4. Enable the integration and sync the datamart

That is all for today

/Johan

Issues with LCS System Diagnostics

I am working with a customer today and we are setting up LCS System Diagnostics on their AX 2012 R3 environment. They have quite a locked down environment which presents some challenges.

First of all we need to open outgoing traffic to LCS and to Azure from the server where we installed LCS according to Microsoft. The adresses are:

Azure: 168.62.1.142:443
LCS: 137.135.11.111:443

If you miss the Azure port no data vill be uploades since the upload is a Zipped file to an Azure Storage account

Johan

Can not create default Keyset when using AXBuild

We have a large deploy with a customer this week which is a very bad time for AXBuild to stop working… really bad time. And ofcourse that is what happened Smile (screw you Murphy). There are of course other ways to to a compile in AX byt doing it from within AX is really slow so AXBuild is much nicer and faster.

The problem was that when I launched AXBuild the process kept crashing with this error:

clip_image002

I also got the following events in Event viewer:

Error 14.11.2016 17:49:05 Dynamics Server 01 110 None
Object Server 01:
Can not create default Keyset. Error code -2146893809.

Error 14.11.2016 17:49:05 Dynamics Server 01 110 None
Object Server 01:
The license information can not be decoded.

Error 14.11.2016 17:49:06 .NET Runtime 1026 None
Application: Ax32Serv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception
Exception Info: System.Runtime.InteropServices.SEHException
Stack:
at <Module>.wmainCRTStartup()
at <Module>.wmainCRTStartup()

When doing research we found that this is most likely a permissions issue and I got somen hints on what to check:

  • Are you running elevated: Check
  • Are you local admin on the AOS computer: Check
  • Is the AOS user local admin on the AOS computer: Check
  • Check AOS user permissions on the AX database and modelstore: Check

I was not able to find the solution so I resorted to Microsoft Support and they sait the same thing… it is a permission issue. So finally I fired up ProcessMonitor (which I don’t do often enough) and the it was after some looking around and filtering. I filtered out everything except the Ax32Serv.exe process and I also removed the SUCCESS lines.

The issue was that my user (the one doing the the compiling) got access denied on a file in the folder:

C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys

I changed the permission on the file and Presto! (or as one of my colleugues said – I am going to get a Cappuchino with cinnamon)

The compile is running and things are good

/Johan

CREATE TABLE permission denied in database ‘tempdb’

This morning we had an incident with a customer who during the night had failed over their SQL cluster during the night and then failed it back again and now AX had stopped working. The error was this:

image

The problem is that when SQL is restarted the permission on tempdb is reset. AX solves this is a “special” way. When AX is installed the install created a stored procedure in master on the SQL server which it calls to set the permissions in case they get lost.

2016-11-10_09-15-41

These was unfortunately missing on one of the nodes so I used Management Studio to script them out and the create them on the node where they were missing

/Johan

Restarting the Software Update Checklist

Today I did an inplace upgrade of AX 2012 CU 8 to CU 10 and found myself having a strange issue. As part of the upgrade you need to complete a checklist including such things as Compile application and detect conflicts… and there is also a couple of times where you need to restart the AOS. When I did this the checklist disapeared and I could not find it. Turns out you can restart it by going to System administration > Setup > Checklists > Software Update Checklist

That all for today folks…

/Johan

The DefaultValue expression for the report parameter ‘AX_CompanyName’ contains an error: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission

This is a follow up to the last post regarding Reports in AX.

When I tried the report I published I got an other error:  The DefaultValue expression for the report parameter ‘AX_CompanyName’ contains an error: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission

image

When I tried the report again it worked… Weird!

Apparently it has to do with the configuration of SSRS. If you open the SSRS configuration file called rssrvpolicy.config in

C:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer

Find the line PermissionSetName=’Execution’ and change it to PermissionSetName=”FullTrust” (remember to make a backup of the file before you change it)

/Johan

Links
https://community.dynamics.com/ax/b/axsupport/archive/2012/02/02/microsoft-dynamics-ax-2012-reporting-extensions-error-system-security-permissions-environmentpermission-while-running-report