I'm trying to Create Role using GP tool and encounter error.
[Operation succeeded with warning messages written to error log file] Error creating role. Failed to execute (CreateRole). Connected as sa. SQL Server 2014. ArcGIS Desktop 10.4.
Can anyone figure out what is wrong.
Solved! Go to Solution.
You seem to be hitting a Bug:
BUG-000093032 - ‘Create Role’ tool fails with ‘Error Creating Role’ error for SQL Server geodatabases at 10.4
The workaround is to create the Role from the Database end.
For more information on this and to make sure you are hitting that Bug, please contact Esri Tech Support.
Hi,
Have you tried following the steps at the following page:
Add logins and users to SQL Server—Help | ArcGIS for Desktop
You seem to be hitting a Bug:
BUG-000093032 - ‘Create Role’ tool fails with ‘Error Creating Role’ error for SQL Server geodatabases at 10.4
The workaround is to create the Role from the Database end.
For more information on this and to make sure you are hitting that Bug, please contact Esri Tech Support.
Is there any update regarding this bug?
As details of that Bug is not public, you will need to contact Esri tech Support for a status update mentioning the Bug#.
Looks like it's fixed in ArcGIS 10.5.
NIM102049: Unable to revoke database roles from SQL Server 2012..
Thanks for your suggestion Adrian Welsh. The logins. user, and privileges are Okay.
Thank you Asrujit SenGupta for the info regarding BUG .
While waiting for ESRI support to respond, I found a work around. Using the pyodbc python library, I was able to replace the following line in my script
arcpy.CreateRole_management(my_connection.sde, "EDITOR", "GRANT", "My Domain\Domain Users")
with
import odbc
conn = pyodbc.connect(r'DRIVER={ODBC Driver 11 for SQL Server};SERVER=MySqlServerInstance;DATABASE=my_database_name;Trusted_Connection=yes;')
cursor = conn.cursor()
cursor.execute("CREATE ROLE EDITOR AUTHORIZATION DBO")
cursor.execute("CREATE USER [My Domain\Domain Users]")
cursor.execute("EXEC sp_addrolemember 'EDITOR', 'My Domain\Domain Users'")
conn.commit()
conn.close()
I hope it helps someone else who doesn't like to wait
-WW