web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

"An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

(0) ShareShare
ReportReport
Posted on by

Hi

I get the below error when creating a new organisation.  If I click ignore, the organisation will complete.

10:17:05|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.InstallSqlClrHelperAction
10:17:05|  Error| System.Exception: Action Microsoft.Crm.Tools.Admin.InstallSqlClrHelperAction failed. ---> System.Data.SqlClient.SqlException: An asymmetric key with name 'MSCRMSqlClrKey' already exists or this asymmetric key already has been added to the database.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, IDictionary`2 parameters, Int32 timeout)
   at Microsoft.Crm.Setup.Database.DatabaseUtility.ExecuteSql(InstallDatabase database, String sql, IDictionary`2 parameters)
   at Microsoft.Crm.Tools.Admin.InstallSqlClrHelperAction.Do(IDictionary parameters)
   at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
   --- End of inner exception stack trace ---, Error, AbortRetryIgnore, Option1
10:28:25|   Info| InputResult: Abort

This may be related to another issue I posted https://community.dynamics.com/crm/f/117/p/137437/294508.aspx#294508

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at
    RE: "An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

    Have you ever used current sql server where you are importing the CRM Organization database as sql failover with CRM?  Take a look at this it gives more information about asymmetric  "MSCRMSqlClrKey".

    http://msdn.microsoft.com/en-us/library/jj822357.aspx

  • d100641ac2e442e7b64b0c1b8751a23d Profile Picture
    on at
    RE: "An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

    Hi Chitra

    We do not use failover.

  • Royal King Profile Picture
    27,686 on at
    RE: "An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

    Can you remove the asymmetric  "MSCRMSqlClrKey" and check whether it resolves the issue or not? It looks this asymmetric  "MSCRMSqlClrKey" is specific to fail over and load balancing scenarios.

  • Arpita Saini Profile Picture
    on at
    RE: "An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

    Looks like a dll is missing. Most probably  "Microsoft.Crm.SqlClr.Helper.dll". You can copy this from a working environment.

  • d100641ac2e442e7b64b0c1b8751a23d Profile Picture
    on at
    RE: "An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

    Thanks for the input.  Im quickly learning about the asymmetric.  Before now, it didn't even know they existed.

    I have discovered the asymmetric key has the wrong name.  CRMSQLCLRKEy instead of MSCRMSQLCLRKEY.  This could be the issue.  Before I go deleting and recreating keys, I need to understand the downtime and how end-users will be affected as the changes will be made on the live server.

    I am trying drop the asymmetric key in my test lab but I get the error message.

    "Cannot drop asymmetric key 'MSCRMSQLCLRKEY' because there is a login mapped to it.". 

    How can I see what logins are associated with the key?

  • Suggested answer
    Gayatri Shevde Profile Picture
    460 on at
    RE: "An asymmetric key with name 'MSCRMSqlClrKey' already exists" error when creating a new org

    Hello ,

    Check if the Microsoft.Crm.SqlClr.Helper.dll does exist in the location: c:\Program files\Microsoft SQL server\MSSQL11.MSSQLSERVER\MSSQL\DATA.

    if it is not present than

    Ran the SQL query to created the MSCRMSqlClrLogin in the database:

    IF NOT EXISTS (SELECT * FROM sys.asymmetric_keys WHERE name = 'MSCRMSqlClrKey')

    BEGIN

    EXECUTE ('CREATE ASYMMETRIC KEY MSCRMSqlClrKey FROM EXECUTABLE FILE =''' + 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\Microsoft.Crm.SqlClr.Helper.dll' + '''')

    END

    IF NOT EXISTS (SELECT * FROM sys.syslogins WHERE name = 'MSCRMSqlClrLogin')

    BEGIN

    CREATE LOGIN MSCRMSqlClrLogin FROM ASYMMETRIC KEY MSCRMSqlClrKey

    GRANT UNSAFE ASSEMBLY TO MSCRMSqlClrLogin

    END

    and then  SELECT * FROM sys.asymmetric_keys

    and check if the asymmetric keys are present or not.

    Regards,

    Gayatri Shevde

    Microsoft Dynamics CRM

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans