Hi!
I tried using the container: mongodb/mongodb-atlas-local with the latest version (redownloaded the images this morning), with the following docker-compose file:
name: database-stack
services:
mongodb-atlas-local:
container_name: mongodb
ports:
- "27017:27017"
volumes:
- D:\databases\mongodb:/data/db
restart: unless-stopped
image: mongodb/mongodb-atlas-local:latest
volumes:
D:
external: true
name: D
When I don’t add the volume, it works flawless. However, after every restart of the server, all of the data is gone. When I add the volume, it starts only the first time, IE when the directory ‘D:\databases\mongodb’ is empty or doesn’t exist. Every time it starts up with a non empty directory I get a looping stackrace:
2024-07-01 09:27:23
2024-07-01 09:27:23 goroutine 1 [running]:
2024-07-01 09:27:23 main.main()
2024-07-01 09:27:23 /app/cmd/runner/main.go:29 +0x11a
2024-07-01 09:27:56 Error: error checking mongod: error pinging: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] }
2024-07-01 09:27:56 Usage:
2024-07-01 09:27:56 runner server [flags]
2024-07-01 09:27:56
2024-07-01 09:27:56 Flags:
2024-07-01 09:27:56 -h, --help help for server
2024-07-01 09:27:56
2024-07-01 09:27:56 panic: error checking mongod: error pinging: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: dial tcp [::1]:27017: connect: connection refused }, ] }
And everytime I try to connect I get a different stacktrace, ending in the following lines:
2024-07-01 09:36:10 {"t":{"$date":"2024-07-01T07:36:10.258+00:00"},"s":"I", "c":"ASIO", "id":22582, "ctx":"main","msg":"Killing all outstanding egress activity."}
2024-07-01 09:36:10 {"t":{"$date":"2024-07-01T07:36:10.258+00:00"},"s":"I", "c":"SHARDING", "id":5847201, "ctx":"main","msg":"Balancer command scheduler stop requested"}
2024-07-01 09:36:10 {"t":{"$date":"2024-07-01T07:36:10.258+00:00"},"s":"I", "c":"ASIO", "id":6529201, "ctx":"main","msg":"Network interface redundant shutdown","attr":{"state":"Stopped"}}
2024-07-01 09:36:10 {"t":{"$date":"2024-07-01T07:36:10.258+00:00"},"s":"I", "c":"ASIO", "id":22582, "ctx":"main","msg":"Killing all outstanding egress activity."}
2024-07-01 09:36:10 {"t":{"$date":"2024-07-01T07:36:10.258+00:00"},"s":"F", "c":"CONTROL", "id":20575, "ctx":"main","msg":"Error creating service context","attr":{"error":"Location5579201: Unable to acquire security key[s]"}}
Does anyone know how I can fix/workaround this issue to use this container for local development? Thanks in advance!