We are starting to develop apps using AtlasDB and for local development trying to use local, containerized version of atlasDB. We are running into the problem where, if we chose to persist data, it works once, but refuses to come up again until we wipe out the data. This seems to be same problem as identified and claimed to be resolved here: Persisting data with mongodb/mongodb-atlas-local
But I have tried the exact “solution” provided in that thread, and it does not work. To replicate simply create an empty directory, place this in the compose.yaml
file and then start it up.
services:
mongo:
image: mongodb/mongodb-atlas-local
container_name: 'mongo'
restart: unless-stopped
ports:
- 27018:27017
volumes:
- mongodb_config:/data/configdb
- mongodb_data:/data/db
volumes:
mongodb_data:
mongodb_config:
Once it is up, shut it down and start again - it will not start with “Primary does not exist”, eventually exiting with error 2
mongo | panic: error checking mongod: error pinging: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: localhost:27017, Type: RSGhost, Average RTT: 1753789 }, ] }
mongo |
mongo | goroutine 1 [running]:
mongo | main.main()
mongo | /app/cmd/runner/main.go:65 +0x174
mongo | {"t":{"$date":"2025-09-08T17:36:29.928+00:00"},"s":"I", "c":"CONTROL", "id":4784903, "ctx":"SignalHandler","msg":"Shutting down the LogicalSessionCache"}
mongo | {"t":{"$date":"2025-09-08T17:36:29.929+00:00"},"s":"I", "c":"-", "id":7350601, "ctx":"SignalHandler","msg":"Shutting down the QueryAnalysisSampler"}
mongo | {"t":{"$date":"2025-09-08T17:36:29.930+00:00"},"s":"I", "c":"NETWORK", "id":8314100, "ctx":"SignalHandler","msg":"Shutdown: Closing listener sockets"}