Create Role Error

4906
8
Jump to solution
05-14-2016 01:27 PM
newbieGIS
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
AsrujitSengupta
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
AdrianWelsh
MVP Honored Contributor

Hi,

Have you tried following the steps at the following page:

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

AsrujitSengupta
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.

WWalker
New Contributor III

Is there any update regarding this bug?

0 Kudos
Asrujit_SenGupta
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
JayantaPoddar
MVP Esteemed Contributor

Looks like it's fixed in ArcGIS 10.5.

NIM102049: Unable to revoke database roles from SQL Server 2012.. 



Think Location
WWalker
New Contributor III

ESRI support states this bug is fixed at 10.4.1.

newbieGIS
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
WWalker
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