Data Upgrade Problem: Failed to create session

I was recently upgrading an application to Dynamics AX 2012 R3 Cumulative Update 8. However, the data upgrade scripts didn’t load properly. AX presented an error “Failed to create session” and there were no batch jobs scheduled.

Dynamics AX Failed to Create Session

There ware 3 partitions in this installation

      • initial Initial Partition
  • ps Public Sector
  • ext Extended
    Three Partitions in Dynamics AX 2012 R3

A detailed look in the dbo.UserInfo table revealed that the User Admin was only linked to the initial partition. However, the user requires access to all three partitions in order to create update scripts for these partitions.

dbo.UserInfo User Admin is missing Partition

The solution was to manually add 2 additional rows to the dbo.UserInfo table for the User Admin and link each row to one of the missing partitions. You may alter 2 existing users in order to get a valid RECID, or just increment the last RecID by 1 and delete the records after the upgrade scripts are finished.

Advertisements

UserSessionService/GetPartitionKey

When you upgrade from Dynamics AX 2012 RTM / FP to R2 and start upgrade your reports in Visual Studio, your might run into an error telling you that the GetPartitionKey action was not found in the UserSessionService.

GetPartitionKey action not found

Partitions were introduced in R2 and therefore the UserSessionService has changed and got new methods. However, the WSDL interface definition is the old one and you need to update the interface description.

AifUserSessionService in AX 2012 RTM and FP AifUserSessionService in AX 2012 R2
AX 2012 FP AX 2012 R2

If you want to check the actual interface description you might want to look at the WSDL itself. The URL can be found at AX > System Administration > Services and AIF > Inbound Ports > User Session Service > WSDL URI

UserSessionService in Dynamics AX 2012 R2

You might open the XML and go all the way through the files until you got the operations, or just feed the URL to Visual Studio. Create a new C# console application, add a service reference and provide the URL. If your WSDL definition is out of date your service reference looks like this.

Check the UserSessionService WSDL in Visual Studio

Go back to Dynamics AX development environment. Compile the AifUserSessionService class in X++ and incremental IL. Make sure there are no errors in your application. Go to the services node in the AOT and select the AifUserSessionService. From the context menu click Add Ins > Register Service. Go to the service group node in the AOT. Select the UserSessionService group. From the context menu click Deploy Service Group. You will see the infolog popping up telling you that the .NET artifacts have been generated and deployed.

Deploy the UserSessionService group

Go back to Visual Studio and refresh the service reference. The service has the same WSDL URL as before but the inferface has changed. Now you should see more methods including the GetPartitionKey.

Check the UserSessionService WSDL in Visual Studio

Upgrade Issues (Part 3)

RefRecId fields without Extended Datatype

The upgrade scripts to AX 2009 converts RefRecId fields to Int64 data types. In some cases when a <Something>RefRecId field on a table has not an extended data type but was created as integer field you get a synchronization error.

Illegal data conversion from original field TABLE.FIELDREFRECID to TABLE.FieldRefRecId: Unable to convert string data types to anything but INT, or REAL field types.

The error message doesn’t really fit to the problem Trauriges Smiley

One way to deal with this issue is to copy the table content to another database. Next delete the malicious field and create a new one with RefRecId as extended datatype. AX will synchronized and delete the field on the database. Finally restore the data from the other database.importexportdb

I recommend to use the SQL Server Data Import/Export wizard.

  1. Create a new database called Backup
  2. Start SQL Server Import / Export from Programs Menu
  3. Source DB is the Upgrade DB
  4. Target DB is Backup (don’t use flat files etc.)
  5. Copy at least on table or view, select the malicious table and run
  6. In AX create a new field named as the defect one but as Int64 with RefRecId data type, e.g. MyRefRecId2
  7. In AX delete the original field and synchronize
  8. Start SQL Server Import/Export from Programs Menu and copy saved data back to Upgrade DB
  9. At selected table or view, activate overwrite instead of append

Upgrade Issues (Part 2)

AX 2009 AOS does not start

There are multiple reasons why the AX 2009 AOS will not start the very first time. One reason may be that some maggots have modified system classes like Info, Sys* etc. Fortunately the AOS posts its pain to the windows event log. In the case of modifications on system classes the AOS posts a stack trace to the event log.

    1. Review the event log errors
    2. Identify the poison modification
    3. Remove the modification in the source system
    4. Copy the cleaned layer file
    5. Delete the .aoi file
    6. Start the AOS

Upgrade Issues (Part 1)

I’ve come across some issues upgrading a Dynamics AX 3.0 Installation to Dynamics AX 2009

SQL Server 2008 R2

A German localized SQL Server Installation may fail on a German(Austria) localized system. “SQL Server setup media does not support the language of the OS or does not have ENU localized files…” In that case you need to change the regional settings from German(Austria) to German(Germany)

AX 2009 Installation

Choosing an SQL Server fails because server was not found or access denied. In SQL Server Configuration Manager make sure

  • SQL Server is running
  • TCP/IP Protocol is enabled
  • IP4 feature in TCP/IP is enabeld
  • The port you are using is not blocked by the firewall sqlconfiguration

Logon to Dynamics AX

First logon to Dynamics AX fails “You are not a recognized user …” . Make sure the user credentials in table UserInfo are correct, especially the Active Directory Security Identified (SID)