Azure / azure-cosmos-db-emulator-docker

This repo serves as hub for managing issues, gathering feedback, and having discussions regarding the Cosmos DB Emulator Docker.
https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator?tabs=docker-linux%2Ccsharp&pivots=api-nosql
MIT License
155 stars 47 forks source link

"mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:mongodb" is expired #112

Open ry0y4n opened 3 weeks ago

ry0y4n commented 3 weeks ago

Today, I pulled the image "mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:~latest~mongodb", and encoutered the following error when run it:

Error: The evaluation period has expired.
./cosmosdb-emulator: ERROR: PAL initialization failed. Error: 104

I found issue #60, and it seem to be related to this problem. This image was created "2024-04-23T04:12:07.234951457Z", and since 180 days have passed, I believe this is cause of the issue. Could you please update the image and publish a new version?

niteshvijay1995 commented 3 weeks ago

A new version is already pushed to latest tag. Please check if old image is cached at your end. Try removing the image on your workstation and pull again.

ry0y4n commented 3 weeks ago

Hi @niteshvijay1995 , Thank you for the quick response.

I have a question: What is the purpose of the mongodb tag image? I’m unsure whether I should use the latest tag or the mongodb tag moving forward.

Could you clarify this for me?

ry0y4n commented 3 weeks ago

@niteshvijay1995 Ah, I realized the title and description of the issue were incorrect. The image I used wasn’t the latest tag, but the mongodb tag, and that’s the one that had expired. I fixed it.

niteshvijay1995 commented 3 weeks ago

You can use the latest tagged image for mongo as well.

ry0y4n commented 3 weeks ago

@niteshvijay1995 Thanks, I'll use latest tagged iamge.

Just to make sure I understand correctly—if the latest tag can also be used for mongo, what is the purpose of having a separate mongodb tag? Am I misunderstanding something about their distinction or usage?

radovanradic commented 1 week ago

I just deleted and pulled mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:mongodb image and I am getting expiration error because the image is 6 months old:

mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator mongodb 94581d68a4f3 6 months ago 2.27GB

How can we get the new version that won't throw expiration error?

niteshvijay1995 commented 1 week ago

I just deleted and pulled mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:mongodb image and I am getting expiration error because the image is 6 months old:

mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator mongodb 94581d68a4f3 6 months ago 2.27GB

How can we get the new version that won't throw expiration error?

Please use latest tag instead of mongodb.

radovanradic commented 1 week ago

I need mongo, mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest is not working on Mac Silicon for me (on Colima or Rancher Desktop).

niteshvijay1995 commented 1 week ago

@radovanradic Can you please share more details on this. What error are you getting or where are you blocked?

Please follow the following steps to try it out.

  1. Install colima
  2. Start colima with arch amd - colima start --arch amd
  3. Docker pull latest emulator image - docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
  4. Docker run with mongo specific environment variable - docker run --publish 8081:8081 --publish 10250-10255:10250-10255 --env AZURE_COSMOS_EMULATOR_ENABLE_MONGODB_ENDPOINT=4.0 --name mongo-linux-emulator mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
  5. Wait for started message in docker logs. We have observed that running emulator with colima is slow and can take few mins to start because of underlying emulation.
  6. Connect to mongo endpoint using any publicly available mongo shell or SDK Endpoint - mongodb://localhost:C2y6yDjf5%2FR%2Bob0N8A7Cgv30VRDJIWEHLM%2B4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw%2FJw%3D%3D@localhost:10255/admin?ssl=true&retryWrites=false
radovanradic commented 1 week ago

Last time I was working with mongodb tag I did not have issues. Now, I am using the emulator (latest) with testcontainers CosmosDBEmulatorContainer and now have waiting strategy that works, container starts up but after some operations it crashes. I see this logged

This program has encountered a fatal error and cannot continue running at Fri Nov  8 09:55:15 2024
The following diagnostic information is available:

         Reason: OS Hard Error (0x00000002)
    Stack Trace:
                 file://package1/windows/system32/sqlpal.dll+0x0000000000209C12
                 file://package1/windows/system32/sqlpal.dll+0x0000000000208D23
                 file://package1/windows/system32/sqlpal.dll+0x000000000023D371
                 file://package1/windows/system32/sqlpal.dll+0x0000000000201F6E
                 file://package1/windows/system32/sqlpal.dll+0x00000000003A03BB
                 file:///windows/system32/ntdll.dll+0x00000000000F8B1F
                 file:///Windows/SYSTEM32/KERNELBASE.dll+0x0000000000102688
                 file:///Packages/ServerService/ServerService.Code/Microsoft.Azure.Cosmos.Server.exe+0x0000000001624F61
                 file:///Packages/ServerService/ServerService.Code/Microsoft.Azure.Cosmos.Server.exe+0x0000000001625002
                 file:///Windows/SYSTEM32/KERNELBASE.dll+0x0000000000087B6C
                 file:///windows/system32/ntdll.dll+0x00000000000DB3F7
                 file:///windows/system32/ntdll.dll+0x00000000000FF526
                 file:///windows/system32/ntdll.dll+0x00000000000E6F06
                 file:///windows/system32/ntdll.dll+0x00000000000F5B06
                 file:///windows/system32/ntdll.dll+0x00000000000FAF8F
                 file:///windows/system32/ntdll.dll+0x000000000009B4B6
                 file:///windows/system32/ntdll.dll+0x00000000000F9CDE
                 file:///Packages/ServerService/ServerService.Code/Microsoft.Azure.Cosmos.Server.exe+0x0000000002CB527C
        Process: 21 - cosmosdb-emulator
         Thread: 141 (application thread 0x1fc)
    Instance Id: 68bd7acd-7aeb-4126-bccd-42b40756fd8d
       Crash Id: d1f6a23d-ea16-42d8-829d-641732a09719
    Build stamp: (null)
   Distribution: Ubuntu 22.04.5 LTS
     Processors: 4
   Total Memory: 16789360640 bytes
      Timestamp: Fri Nov  8 09:55:15 2024
     Last errno: -34938881
Last errno text: Unknown error -34938881
Capturing a dump of 21

Apologies @ry0y4n for hijacking your issue.

niteshvijay1995 commented 1 week ago

Please share the generated dump file. I will try to debug it.