Tuesday, July 11, 2017

Failed to create session during database synchronization

Error : Failed to create session during database synchronization

Solution : 
Check System Service Account user have db_datareader, db_datawriter, db_ddladmin and db_owner permission on database

If you Import contoso database using Data Transfer Tool and upgrade it to CU12:


  • I believe the reason for recreating partitions is because when you import the Demo Data using Data Transfer Tool some system tables are left untouched, including UserInfo table, and the cockpit needs an Admin account for each partition to use on “RunAs”.
  • The Demo Data consists of three partitions, Initial (default), Public Sector and Extended, for some reason when I deleted the partitions and created again, it didn’t create an Admin account for every new partition.


  • My solution was to create an Admin account for each partition through job in Dynamics AX.

static void CreateUserAdmin(Args _args)
{
       UserInfo userInfo;
       select userInfo where userInfo.id == 'Admin';
       userInfo.(fieldNum(UserInfo, Partition)) = 5637144578;
       userInfo.insert();
}


  • This job selects a record from UserInfo with ID equals to Admin and then it modifies the field partition to a manual value, that’s why I had to use “(fieldNum(UserInfo, Partition))”, otherwise AX won’t let me assign a value manually.
  • Checking records through SQL Management Studio again using below query 

SELECT ID, PARTITION, PARTITIONS.NAME
FROM USERINFO
INNER JOIN PARTITIONS ON USERINFO.PARTITION = PARTITIONS.RECID
WHERE USERINFO.ID = 'Admin'


  • After completed above procedure restart  AOS service and check Upgrade Cockpit.

No comments:

Post a Comment