Monday, 11 April 2016

Failed To Create a Session Confirm That The User Has The Proper Privileges….!!!

Option 1: Partitions

If someone has setup a new environment for you and imported the demo data using the “Test Data Transfer Tool” you can run into this error upon sync.  The reason you get this error is that there are 3 partitions:   Ext, Initial and PS and userInfo was only given to the initial partition.  What you need to do to resolve this issue is:
a. First in SQL review the userinfo table and checkout how many times you see the Admin ID in the table:  select * from userinfo where id = ‘admin’
b. I’m guessing you only see the admin record one time and this would be the problem.  When you have multiple partitions you should see the record in there for as many partitions as you have.  So, in our instance there should be 3 admin records in the userinfo table.
c. In SQL I usually run this command:  delete PARTITIONS where PARTITIONKEY in (‘ext’‘ps’)
d. Next open the AX client and navigate to:  System Administration > Setup > Partitions.
e. You should only see one partition called “Initial”.  We need to recreate the two we delete via our SQL script.  So create two new partitions called:  Ext and PS as seen below.
f. Go review the userinfo table in SQL you should see that two new records have been automatically added for the administrator account.
g. Now try to sync the database in AX and you should have success!

Option 2: Run Business Logic

The second thing you can try which occasionally works is to run the business logic not using IL.  You can disable this by:
a. In the AX client navigate to:  File > Tools > Options > Development hyperlink.
b. Unmark “Execute Business Operations in CIL”.
c.  Close the AX app and restart your AOS.
d. Open AX and try to Sync.


Option 3. Run a Full CIL.

a. To do this restart your AOS 1st and then from the AX Development Environment go to:
i. Build > Generate Full CIL.
b. Now try to Sync.

Option 4: Delete your AUC Files.

NOTE:  The AUC file is a cache of objects from the AOT.
a. Close out of AX.
b. Navigate to one of the following:
i. Windows XP and Windows 2003
C:\Documents and Settings\%username%\Local Settings\Application Data
ii. Windows Vista, Windows 7 and Windows 2008
c. Delete the file or files with the extension .auc.
d. Open AX and try to Sync.

Option 5: Improper Privileges

The user actually doesn’t have the proper privileges in SQL to run a sync which means they aren’t in the db.reader and db.datawrite roles.  You can review this blog to check your SQL User Mapping.