Create Role Error

3547
8
Jump to solution
05-14-2016 01:27 PM
Highlighted
New Contributor

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.

1 Solution

Accepted Solutions
Highlighted
Regular Contributor III

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.

View solution in original post

8 Replies
Highlighted
MVP Notable Contributor

Hi,

Have you tried following the steps at the following page:

Add logins and users to SQL Server—Help | ArcGIS for Desktop

Highlighted
Regular Contributor III

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.

View solution in original post

Highlighted
New Contributor III

Is there any update regarding this bug?

0 Kudos
Highlighted
MVP Regular Contributor

As details of that Bug is not public, you will need to contact Esri tech Support for a status update mentioning the Bug#.

0 Kudos
Highlighted
Honored Contributor
Highlighted
New Contributor III

ESRI support states this bug is fixed at 10.4.1.

Highlighted
New Contributor

Thanks for your suggestion Adrian Welsh​. The logins. user, and privileges are Okay.

Thank you Asrujit SenGupta​ for the info regarding BUG .

0 Kudos
Highlighted
New Contributor III

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