Docker vault setup gives error that vault cant connect to mongodb
Docker vault setup gives error that vault cant connect to mongodb
Same error here
Same error here
Can you provide some context? Docker compose? Stand-alone docker?
Hi, i have the same error.
@NikolaBoyko can you provide details of your setup?
@cedricve yes context: docker-compose (custom but i think that problem identically) i found that this in name resolving in vault binary i wrote a custom entrypoint that resolve mongo container name to ip and setup it in MONGODB_HOST. It resolve the problem
my entrypoint.sh
#!/bin/sh echo $MONGODB_HOST nslookup kerberos-mongo echo $(nslookup $MONGODB_HOST) export MONGODB_HOST=$(nslookup $MONGODB_HOST | awk -F': ' 'NR==8 { print $2 } ') echo $MONGODB_HOST ./main serve
Hmm I just ran the current docker-compose.yaml it returns this on boot:
kerberos-vault | Error en mongo: no reachable servers
kerberos-vault exited with code 1
But afterwards it recovers:
kerberos-vault | time="2023-05-28T18:33:15Z" level=info msg="Running Kerberos Vault on :80"
kerberos-vault | time="2023-05-28T18:33:15Z" level=info msg="Cleanup: nothing to be removed from erg"
Hey all, I believe this error was caused due to some setup time for MongoDB. The Kerberos Vault was connecting to mongodb, before it was properly initialised. Please find the fix here: https://github.com/kerberos-io/vault/commit/cfc02d1579dab683386971ec717d1968d747b7bb. I also disabled Ingress by default, as most users would be willing to use it without DNS names. Now both Vault :80 and Minio :9000 are exposed.
@NikolaBoyko can you verify if this helps for you as well?
I try wait mongo with wait.sh it did not help. I try your fix tomorrow, thanks.
Hi! @cedricve your fix don't help, but problem was resolved in container version kerberos/vault:1.0.882646955. I think fix is identical to kerberos-io/agent#101
hmm indeed might be the case! Waiting for other people to confirm fix.