Azure-docs: Cosmos DB Emulator wont start

Created on 5 Apr 2018  Â·  53Comments  Â·  Source: MicrosoftDocs/azure-docs

I cant seem to start the Cosmos DB Emulator. I have windows 10 and it appears to install fine, but when I click to start it up I see the tray icon appear and then it disappears before I can click on it. The localhost landing page "https://localhost:8081/_explorer/index.html" does not appear and I cannot navigate to it either

I have tried to restart my machine. Uninstall the application. Turn off the IIS web server I use for debugging but nothing appears to work.

I have ran the command "lodctr /R" and got a successful message back from running it, it still wont start.

I tried to look for the crash dumps at c:\Users\user_name\AppData\Local\CrashDump but I see no crashDump files

I have tried to launch the Emulator as an administrator but it still wont start.

I tried to Collect trace files with the following steps

  1. cd /d "%ProgramFiles%\Azure Cosmos DB Emulator"
  2. CosmosDB.Emulator.exe /shutdown. Watch the system tray to make sure the program has shut down, it may take a minute. You can also just click Exit in the Azure Cosmos DB emulator user interface.
  3. CosmosDB.Emulator.exe /starttraces
  4. CosmosDB.Emulator.exe
  5. Reproduce the problem. If Data Explorer is not working, you only need to wait for the browser to open for a few seconds to catch the error.
  6. CosmosDB.Emulator.exe /stoptraces
  7. Navigate to %ProgramFiles%\Azure Cosmos DB Emulator and find the docdbemulator_000001.etl file.
    Send the .etl file along with repro steps to [email protected] for debugging.

but I dont get any trace files either. Im not sure what is wrong at this point in time


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 assigned-to-author cosmos-dsvc product-issue triaged

Most helpful comment

I also have problems starting the new version of the emulator (2.0.0.0).
The emulator seems to start perfectly, but Data Explorer web page says "ERR_CONNECTION_REFUSED".
And I'm also unable to reach the emulator API.

I already tried to uninstall and reinstall - still does not work.
I rebooted the computer several times - still does not work.
I tried to run "LODCTR /R" several times - still does not work.
I also enabled traces with "CosmosDB.Emulator.exe /starttraces", I'm not sure, but maybe that is why I got a "docdbemulator_000001.etl" with 187MB in just a few minutes.

Can please someone help me out?

EDIT:
I found this other issue: https://github.com/Azure/azure-cosmosdb-dotnet/issues/470
I followed the steps mentioned by ToddTaylor, and it worked.
Apparently the new installer was not able to completely delete the old folder, some assemblies were still there and were causing some issues.
I also found out I had two version of the emulator installed (like andreas mentions), so probably removing both would also work.

All 53 comments

@Frankwayne Thanks for the feedback. Please help us with the link of the document on which above feedback is provided.

@Frankwayne Can you try the following as detailed in this Stack Overflow thread: documentdb emulator gatewayservice crashing on startup

C:\WINDOWS\system32>LODCTR /R

You may need to run this twice.
Regards,
Mike

@Mike-Ubezzi-MSFT Sure I ran the commands and it still wont start up but I did try the debugging command for the gatewayservice and this is what I got

PS C:\Program Files\Azure Cosmos DB Emulator\Packages\GatewayService\GatewayService.Code> .\DocumentDB.GatewayService.exe /?

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Fabric, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at Microsoft.Azure.Documents.Azure.GatewayService.GatewayHost.Main()

@Frankwayne Can you send this information to the [email protected] alias, where the Cosmos DB product group can review this and provide assistance. If you cannot provide an .etl file, provide the information you have provided in your last comment (collect trace files).

The other option is to uninstall and reinstall.

@Mike-Ubezzi-MSFT I have sent them an email, and if I get a working solution I will post the information on how to correct the system on this issue case.

Thanks for your help

@Frankwayne We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion. Any resolution provided by the Cosmos DB team can still be posted here in a 'closed' status.
Regards,
Mike

@Frankwayne Hi there,
I'm the dev owner of the Emulator and would like to get to the bottom of this. Are you up for a remote Skype session?
Best,
David Noble

@David-Noble-at-work Certainly. What times work best for you ? I'm on the east coast and this is work related so I can also have a session during work hours as well. I'm also free this sunday too.

@Frankwayne Did this get resolved? Thanks, Mike

@Frankwayne We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion. You have the option of reaching Cosmos DB Emulator support via [email protected] per the instructions outlined here.
Regards,
Mike

@Mike-Ubezzi-MSFT no we have not resolved this issue. I have been waiting for mike to David to get back to me when we could do the skype session

@Frankwayne I am going to try to assist you and with the information we uncover, hopefully we identify the issue or I will have enough to pass on to @David-Noble-at-work and the askcosmosdb email alias.
If you go to Event Viewer (Local) > Windows Logs > Application, and look for any CosmosDB.Emulator entries, do you see any start-up failure entries? I have over 200 Informational entries pertaining to my Cosmos DB Emulator starting up.

The other option is to trying starting the Emulator on another port (the default is 8081). Make use the Emulator is completely stopped before attempting to restart:

Command-Line Tool Reference

Controlling the Emulator

This requires using PowerShell. I can work with you via Skype, if you desire.

Regards,
Mike

@Mike-Ubezzi-MSFT I see no logs in the windows/Application event viewer logs for the CosmosDB.Emulator source.

Starting the emulator on another port with the command

.\CosmosDB.Emulator.exe /port=8085 gives the same behavior where nothing happens, I can see the icon when I open my hidden icons on my system tool tray and then it disappears. I have also ran the /shutdown command as well before running the /port command and I still get the same behavior.

@Frankwayne Are you available for a Skype Call at this time? I have @David-Noble-at-work available to look into this issue. If not now, please provide a couple times that will fit your schedule. Thanks!

@Frankwayne what version of the Emulator are you running? The current version is 1.22 which was published on 2018.04.20. Please install it from here, if you've not got the latest.

@David-Noble-at-work I had 1.21 just installed the 1.22 version

nothing in the event viewer this time either. I'm open for a skype session to debug this issue whenever. I just have an engagement this Saturday

Is it possible that there is something blocking the process ? I looked in my antivirus but its not reporting any blocked process. My co-workers also have the same antivirus but they have no issues.

Maybe I need to open something in windows firewall or something.

@Frankwayne Is this a plain-vanilla Windows 10 machine? If not, what software is installed?

Even though the latest 1.22 version has been installed, please follow these steps:

• Ensure that all emulator processes are stopped:
CosmosDB.Emulator
DocumentDB.GatewayService
DocumentDB.Master
DocumentDB.Server

• Delete the data directory: %LOCALAPPDATA%\CosmosDBEmulator

• Uninstall the Emulator

• Download and install the current version of the Emulator (v1.22) from https://aka.ms/cosmosdb-emulator without starting it.

• Start the emulator from a command line

cd "%ProgramFiles%\Azure Cosmos DB Emulator"
CosmosDB.Emulator.exe /starttraces
CosmosDB.Emulator.exe

• Wait until the emulator is fully started as reported from the task bar and if we get that far, create some data.

If the Emulator fails to start, we might enable fusion logs and repeat the prior steps.

@Frankwayne I want to check in to see if you have resolved this or if you still have issues with the emulator.
Thanks,
Mike

We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

sorry I had other important work take my time away from this issue. I'm still facing this issue.

I have SQL server 2017, visual studio 2017, Azure service fabric sdk. This is my dev machine so I got a whole bunch of stuff installed. if you want a full list I can run the powershell command

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize

which should get you a list of most of the installed software

there was no folder in the follow dir %LOCALAPPDATA%\CosmosDBEmulator AKA Users{username}\AppData\CosmosDBEmulator

I dont see any of the process running in task manager

CosmosDB.Emulator
DocumentDB.GatewayService
DocumentDB.Master
DocumentDB.Server

uninstalling and reinstalling does not appear to help either. Can I get the steps to enable the fusion logs ?

@Frankwayne Thanks for the feedback! I have assigned the issue to the content author to evaluate and update as appropriate.

same issue here. page( https://localhost:8081/_explorer/index.html) shows the following:

This site can’t be reached
The connection was reset.
Try:

Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_RESET

@Jiping-hi Can you please do a netstat -a and identify any existing services that are listening on the ports you have configured for CosmosDB.Emulator.

I should tell before that I remote desktop to a Windows Server using my Domain Account Administrator.

  1. changing port doesn't work;
  2. found error log in "Event Viewer(local) > Windows Logs > Application", two related error logs, one says:

Application: DocumentDB.StartupEntryPoint.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.Principal.IdentityNotMappedException
at System.Security.Principal.NTAccount.Translate(System.Security.Principal.IdentityReferenceCollection, System.Type, Boolean)
at System.Security.Principal.NTAccount.Translate(System.Type)
at Microsoft.Azure.Documents.Common.SecurityUtil.AccountNameToSid(System.String)
at Microsoft.Azure.Documents.Services.ServiceStartupEntryPoint.ServiceStartupEntryPoint.GetSecurityGroupSid(System.String)
at Microsoft.Azure.Documents.Services.ServiceStartupEntryPoint.ServiceStartupEntryPoint.GatewayInit(System.Fabric.CodePackageActivationContext)
at Microsoft.Azure.Documents.Services.ServiceStartupEntryPoint.ServiceStartupEntryPoint.Main(System.String[])

@Jiping-hi Can you please follow the steps outlined in Troubleshooting, followed by sending the data collected in Collect trace files, and send the information to [email protected]

Thank you!

Thanks, Mike. It seems the Domain Controller role caused this.

Don't bother, I will use other ways to run Cosmos DB, like a Docker or VM, or other non-AD Windows machine.

@Jiping-hi We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

@Mike-Ubezzi-MSFT I hit the same issue and posted in https://github.com/Azure/azure-cosmosdb-dotnet/issues/471 . Can we re-open this issue and follow up on it? The issue shouldn't be hard to fix.

@Yaming-Liu1978 Can you open a new GitHub Issue from this document: https://docs.microsoft.com/en-us/azure/cosmos-db/local-emulator
That way we have a new instance with only a single issue to be solved with root cause detailed. Thank you.

@Yaming-Liu1978 The Emulator is not designed to run on a domain controller. In short it cannot be run on a machine with Active Directory installed. The Emulator creates a number (3) of group accounts that it uses for security purposes. You found one of them: DocDBGatewayService. Does your dev/test environment provide an alternative to installing the Emulator on a machine together with Active Directory?

Hey David, this seems to be a regression in the emulator. I've been using it since its first release on a domain-joined virtual machine. This only broke when I upgraded to 2.0.0. Can you look into what caused the regression?

DA is very special, I've found many applications require no DA. I will never install DA if possible(fortunately, we have Azure AD now), otherwise would not install Cosmos DB on DA.

This issue impacts machines joined with an Azure AD directory as well. This issue is a regression that bricks the emulator for users who want to use (or are required to use) single-sign-on for their development machines.

I also have problems starting the new version of the emulator (2.0.0.0).
The emulator seems to start perfectly, but Data Explorer web page says "ERR_CONNECTION_REFUSED".
And I'm also unable to reach the emulator API.

I already tried to uninstall and reinstall - still does not work.
I rebooted the computer several times - still does not work.
I tried to run "LODCTR /R" several times - still does not work.
I also enabled traces with "CosmosDB.Emulator.exe /starttraces", I'm not sure, but maybe that is why I got a "docdbemulator_000001.etl" with 187MB in just a few minutes.

Can please someone help me out?

EDIT:
I found this other issue: https://github.com/Azure/azure-cosmosdb-dotnet/issues/470
I followed the steps mentioned by ToddTaylor, and it worked.
Apparently the new installer was not able to completely delete the old folder, some assemblies were still there and were causing some issues.
I also found out I had two version of the emulator installed (like andreas mentions), so probably removing both would also work.

I had the same problem. I discovered that I had two versions of the emulator installed. 2.0 and 1.1.2. I uninstalled both of them from Apps and functions (that I think the English translation would be, I have a Swedish version of Windows 10).

Then I installed 2.0 again. Now the Data Explorer web page works again.

This just happened to me tonight. I have a demo I have to show tomorrow, and then this happens:

This site can’t be reached localhost refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

I tried to uninstall, I removed any residuals, removed the directory, reinstalled, and same problem. This didn't happen 5 days ago, and nothing changed since then. No idea how to resolve this, and I'm running out of options.

I even upgraded it to 2.1.2, and still nada.

I did this...

netsh http add iplisten ipaddress=0.0.0.0

and it worked... wow

I am having the same problem with 2.1.x.

When I updated to 2.* my previous version was still installed and interfered with current.

  1. Uninstall all versions of emulator
  2. Reboot
  3. Install latest
    These simple steps actually helped me.

Thanks @IlyaNikitinMs I will give it a shot.
Perhaps the team should work on a more robust and easy upgrade path, moving forward?

Yup @IlyaNikitinMs Something very close to your steps seems to be working.
Thanks again :)

Hi, I am experiencing a similar issue to what @Frankwayne reported. This is on version 2.1.4-44c12ee7. The CosmosDB emulator just keeps shutting down with no etl traces or anything of that sort immediately after starting it.

Based on what said here earlier, I attempted to start the Microsoft.Azure.Cosmos.GatewayService.exe and I get a COMExcpetion. It seems to be unable to find a environment option....

Should I create a new issue or would someone want to re-open this issue again?

(I have tried the aforementioned steps mentioned by @Mike-Ubezzi-MSFT to no avail)

Same problem as ifexception above. 2.1.4-050276f1. Upgraded from 1.22

Cannot open web UI on port 8081. No other processes are using the port.

Just installed 2.1.4.0 and get same error.
This site can’t be reached The connection was reset.
Try:

Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_RESET

Ran as administrator and it prompted for /NoFirewall arg.
Still no access to Data Explorer.
Re-installing Azure VS tools/sdks.

Will report back.
No Luck :(

Event logs show this error...
Application: Microsoft.Azure.Cosmos.ComputeServiceStartupEntryPoint.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.AccessControl.PrivilegeNotHeldException
at System.Security.AccessControl.Privilege.ToggleState(Boolean)
at System.Security.Cryptography.Utils.GetKeySetSecurityInfo(System.Security.Cryptography.SafeProvHandle, System.Security.AccessControl.AccessControlSections)
at System.Security.Cryptography.CspKeyContainerInfo.get_CryptoKeySecurity()
at Microsoft.Azure.Documents.Common.CertificateUtil.SetCertificateAcl(System.Security.Cryptography.X509Certificates.X509Certificate2, System.String, Boolean)
at Microsoft.Azure.CosmosDB.ServiceStartupEntryPoint.ServiceStartupEntryPoint.CosmosDBGatewayInit(System.Fabric.CodePackageActivationContext)
at Microsoft.Azure.CosmosDB.ServiceStartupEntryPoint.ServiceStartupEntryPoint.Main(System.String[])

I uninstalled the application. Deleted the program files remnants...that took some effort. Re-installed. All is working now.

Key piece was to completely delete the remnants of C:\Program Files\Azure Cosmos DB Emulator

I get this when I try to open the data explorer (note usually when you start cosmos it does this automatically but once this problem started it never appears to get to that point) and I'm on version 2.4.5.0

Failed to get authorization headers for offers: {"readyState":4,"responseText":"{\"code\":\"InternalServerError\",\"message\":\"Service is currently unavailable, please retry after a while. If this problem persists please contact support.\r\nActivityId: 9ab400c2-048d-43e3-9b44-1b13ebce92de, Microsoft.Azure.Documents.Common/2.4.0.0\"}","responseJSON":{"code":"InternalServerError","message":"Service is currently unavailable, please retry after a while. If this problem persists please contact support.\r\nActivityId: 9ab400c2-048d-43e3-9b44-1b13ebce92de, Microsoft.Azure.Documents.Common/2.4.0.0"},"status":500,"statusText":"error"}

stopping the process and deleting %LOCALAPPDATA%\CosmosDBEmulator resolved the issue

Additional troubleshooting steps can be found here.

As @faldeland suggested, uninstalling and then deleting the remaining folder/files of "C:\Program Files\Azure Cosmos DB Emulator" fixed the issue for me.

Thank you! It's the remnants in the "C:\Program Files\Azure Cosmos DB Emulator" folder that did it. You know, a lot more people would probably use CosmosDB if the emulator wasn't such a bear. :)

Just as an optional workaround if anyone other than me hits this issue and doesn't want to reinstall and re-clone data from an existing DB on Azure:

I hit this issue today where the emulator appeared to be running, but the Data Explorer was unavailable. The last time I hit it, I was able to resolve by uninstalling, deleting everything, and re-installing. However, as I was trying to test a bug, I also needed to clone my entire DB from Azure (which took about 2-3 hours). I didn't want to do that again. This time, since I already have it installed, I thought I'd check the Microsoft Azure Storage Explorer. All of my emulator data/stored procedures/etc were there and accessible.

https://azure.microsoft.com/en-us/features/storage-explorer/

This seems specific to IE and I could see data explorer working on Chrome

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnam89 picture behnam89  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments