Troubleshooting Azure Cosmos DB Emulator Startup Failure after Certificate Manipulation

William 0 Reputation points
2023-11-17T17:45:20.2266667+00:00

I am experiencing difficulties with the Azure Cosmos DB Emulator on my system. Initially, I faced a certificate error, which led me to delete the Cosmos DB related certificates from both the Trusted Root and Personal stores. Afterward, I attempted to regenerate these certificates using Microsoft.Azure.Cosmos.Emulator.exe /GenCert, but this did not resolve the issue.

Current Problem: Now, when I try to start the Emulator, I receive the following error message:

Error: multiple attempts to restart one of the Azure Cosmos Emulator processes were detected. The emulator will shutdown. If the problem persists please try uninstalling the Azure Cosmos Emulator, remove the CosmosDBEmulator directory from your %%LOCALAPPDATA%% and reinstall.

Event Viewer Logs:

  • Faulting application name: Microsoft.Azure.Cosmos.StartupEntryPoint.exe, version: 2.14.0.0
  • Faulting module name: KERNELBASE.dll
  • Exception code: 0xe0434352

Detailed cryptographic exception information

Application: Microsoft.Azure.Cosmos.StartupEntryPoint.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.Cryptography.CryptographicException
   at System.Security.Cryptography.Utils.CreateProvHandle(System.Security.Cryptography.CspParameters, Boolean)
   at System.Security.Cryptography.Utils.GetKeyPairHelper(System.Security.Cryptography.CspAlgorithmType, System.Security.Cryptography.CspParameters, Boolean, Int32, System.Security.Cryptography.SafeProvHandle ByRef, System.Security.Cryptography.SafeKeyHandle ByRef)
   at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
   at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32, System.Security.Cryptography.CspParameters, Boolean)
   at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()
   at Microsoft.Azure.Cosmos.ServiceFramework.EntryPoint.AclCertificateUtil.SetCertificateAcl(System.Security.Cryptography.X509Certificates.X509Certificate2, System.String, Boolean)
   at Microsoft.Azure.Cosmos.ServiceFramework.EntryPoint.AclCertificateUtil.SetCertificateAclByCommonName(System.String, System.String, System.Security.Cryptography.X509Certificates.StoreName, System.Security.Cryptography.X509Certificates.StoreLocation, Boolean, Boolean)
   at Microsoft.Azure.Documents.Services.StartupEntryPoint.GatewayServiceSetupCommand.GatewayInit(System.Fabric.CodePackageActivationContext)
   at Microsoft.Azure.Documents.Services.StartupEntryPoint.GatewayServiceSetupCommand+<>c.<AddCommand>b__3_1()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(System.String[])
   at Microsoft.Azure.Documents.Services.StartupEntryPoint.ServiceStartupEntryPoint.Main(System.String[])


Attempts to Resolve:

  • Used the installer's repair tool.
  • Tried regenerating the certificates.
  • Reviewed Event Viewer for additional clues.

Constraints: I am hesitant to uninstall and reinstall the Cosmos DB Emulator due to uncertainty about handling data backup and restoration. I also have a trace file available if it might be helpful for diagnostic purposes but I cant upload it here.

Any insights or suggestions would be greatly appreciated !

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,689 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.