Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Violation of UNIQUE KEY constraint 'IX_RoleName'Violation of UNIQUE KEY constraint 'IX_RoleName'
Previous
 
Next
New Post
8/31/2016 4:56 PM
 

How do I fix the following error? I do see two records

Violation of UNIQUE KEY constraint 'IX_RoleName'. Cannot insert duplicate key in object 'dbo.Roles'. The duplicate key value is (0, MyADGroup {f64b0102-c015-43ca-b6eb-5383918b77)

 
New Post
8/31/2016 6:19 PM
 
When does this error occurr?
It looks like there AD is synchronizing two records with same unique key.
are you able to trace down synchronization of AD roles?

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
8/31/2016 6:38 PM
 

How do I trace it and fix it?

The error is only happening to a couple of users and I think Roles and Portals data is messed up for selected users

 
New Post
8/31/2016 6:49 PM
 

Here is the full log:

 

2016-08-31 17:44:08,779 [MySQLServer][Thread:29][ERROR] YourCompany.EasyAD.ViewEasyAD - FriendlyMessage="Error: Mycompany EasyAD Login is currently unavailable." ctrl="ASP.desktopmodules_easyad_vieweasyad_ascx" exc="System.ArgumentException: System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_RoleName'. Cannot insert duplicate key in object 'dbo.Roles'. The duplicate key value is (0, MyADGroup {f64b0102-c015-43ca-b6eb-5383918b77).

The statement has been terminated.

   at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteScalar()

   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)

   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)

   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues)

   at DotNetNuke.Security.Membership.Data.SqlDataProvider.AddRole(Int32 portalId, Int32 roleGroupId, String roleName, String description, Single serviceFee, String billingPeriod, String billingFrequency, Single trialFee, Int32 trialPeriod, String trialFrequency, Boolean isPublic, Boolean autoAssignment, String rsvpCode, String iconFile, Int32 createdByUserID, Int32 status, Int32 securityMode)

   at DotNetNuke.Security.Membership.DNNRoleProvider.CreateRole(RoleInfo role)

   at DotNetNuke.Security.Membership.DNNRoleProvider.CreateRole(RoleInfo role)

   at DotNetNuke.Security.Roles.Internal.RoleControllerImpl.AddRole(RoleInfo role)

   at DotNetNuke.Security.Roles.RoleController.AddRole(RoleInfo role)

   at YourCompany.EasyAD.ViewEasyAD.CAAA1(String ?)"

2016-08-31 17:44:08,810 [MySQLServer][Thread:29][ERROR] YourCompany.EasyAD.ViewEasyAD - FriendlyMessage="Error: Mycompany EasyAD Login is currently unavailable." ctrl="ASP.desktopmodules_easyad_vieweasyad_ascx" exc="System.ArgumentException: System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_RoleName'. Cannot insert duplicate key in object 'dbo.Roles'. The duplicate key value is (0, MyADGroup {8d2cc321-d3ae-4b6b-9b29-08821790bf).

The statement has been terminated.

   at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

   at System.Data.SqlClient.SqlCommand.ExecuteScalar()

   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters)

   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters)

   at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues)

   at DotNetNuke.Security.Membership.Data.SqlDataProvider.AddRole(Int32 portalId, Int32 roleGroupId, String roleName, String description, Single serviceFee, String billingPeriod, String billingFrequency, Single trialFee, Int32 trialPeriod, String trialFrequency, Boolean isPublic, Boolean autoAssignment, String rsvpCode, String iconFile, Int32 createdByUserID, Int32 status, Int32 securityMode)

   at DotNetNuke.Security.Membership.DNNRoleProvider.CreateRole(RoleInfo role)

   at DotNetNuke.Security.Membership.DNNRoleProvider.CreateRole(RoleInfo role)

   at DotNetNuke.Security.Roles.Internal.RoleControllerImpl.AddRole(RoleInfo role)

   at DotNetNuke.Security.Roles.RoleController.AddRole(RoleInfo role)

   at YourCompany.EasyAD.ViewEasyAD.CAAA1(String ?)"

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Violation of UNIQUE KEY constraint 'IX_RoleName'Violation of UNIQUE KEY constraint 'IX_RoleName'


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out