'azure-cosmos-emulator hangs when I try to create a database

I am on a mac, trying to run the linux azure-cosmos-emulator emulator but every time I start the image and try to create a database, it just hangs and never creates the database. There is nothing showing in the container log. How can I fix this or troubleshoot it?

Here is my setup. What am I doing wrong?

version: '2.4'

## to run:
##  export EXTERNAL_IP=$(ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' | head -n 1)
##  docker-compose up -d

services:

  cosmosdb:
    container_name: cosmosdb
    hostname: cosmosdb
    image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator
    platform: linux
    tty: true
    restart: always
    mem_limit: 3GB
    ports:
      - '8081:8081'
      - '8900-8902'
      - '10250-10256'
      - '10350:10350'
    environment:
      AZURE_COSMOS_EMULATOR_PARTITION_COUNT: 10
      AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE: true
      AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE: ${EXTERNAL_IP}
    volumes:
      -  vol_cosmos:/tmp/cosmos.data

volumes:
  vol_cosmos:

NOTE1: The folder /tmp/cosmos.data is a folder with 777 permissions on my Mac. When I start the container, I don't see any files be created in this folder. NOTE2: I also tried setting the persistance flat to false. Still cannot create database. NOTE3: I had this working at one point but I don't know what I did to break it.



Solution 1:[1]

After the emulator is running you must install certificate. The emulator is using a self-signed certificate to secure the connectivity to its endpoint and needs to be manually trusted.

To install the certificate and consume the end points via UI this may help you.

OR

This can be due to the number of physical partitions provided on the emulator is too low. Either delete your unused databases/collections or start the emulator with a larger number of physical partitions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PratikLad-MT