AX2012 R2 : DB Sync – Failed to create a session

 

Thanks to a Kevin Roos, for spending the time to look into this one!

We have been seeing the following error lately in AX2012 R2:

Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics

A closer look into this learned that this is linked to the new partitions feature.

It seems the UserInfo table is not correctly updated and the partition administrator is not updated correctly when you restore an existing DB or the Demo database.
To fix this, you can do the following.

  • Stop the AOS
  • Restore the database again
  • Start the AOS
  • Start a client and complete the partition initialiasation checklist
  • Close the client and execute the script below on the SQL database
  • Restart the client and reimport your license (if you were restoring the Microsoft demo data, the demo license is back in there)
  • Then compile / generate CIL / DB sync and you should be on track again!

The script for updating the UserInfo inforation is as follows:

DECLARE @NetworkDomain nvarchar(255); 
DECLARE @NetworkAlias nvarchar(80); 
DECLARE @SID nvarchar(124); DECLARE @InitialPartition BIGINT; 
 
SELECT @InitialPartition=Recid FROM PARTITIONS WHERE PARTITIONKEY=N'Initial' 
 
SELECT @NetworkAlias=NETWORKALIAS,@NetworkDomain=NETWORKDOMAIN,@SID=SID FROM USERINFO WHERE PARTITION=@InitialPartition AND ID = N'Admin' 
 
UPDATE USERINFO SET NETWORKDOMAIN=@NetworkDomain,NETWORKALIAS=@NetworkAlias,SID=@SID WHERE PARTITION != @InitialPartition AND ID = N'Admin'

 

12 thoughts on “AX2012 R2 : DB Sync – Failed to create a session

  1. “..confirm that the user has the proper privileges..”

    Check if the AX AOS service account has the appropriate database roles (reader, writer, admin) assigned to the model and data database, is an ax user and has access to the application folder.

    Reviewing the authorization settings for the AX service account solved this issue in my case.

    cheers
    paulrybski

  2. For me this occured in context of an inbound file system port on AX without R2 installed.

    The reason for this error was that the creator of the file was not recognized by AX. I reproduced this by opening the XML-File and saving it in the inbound folder.

  3. Thank you very much, you just made my day! XD
    In my case, it also occurred during data upgrade cockpit.

  4. Thanks, great suggestion.

    But while creating users in ax, it will not create for all partitions. Make sure that the user(Admin) exist in the UserInfoTable with all the partitions before running it.

  5. Pingback: AX2012 R2 : DB Sync – Failed to create a session | my DAX Journal

Leave a Comment Yourself

Your email address will not be published. Required fields are marked *