Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker vault setup gives error that vault cant connect to mongodb #10

Open
mdupreejr opened this issue May 24, 2023 · 12 comments
Open

Docker vault setup gives error that vault cant connect to mongodb #10

mdupreejr opened this issue May 24, 2023 · 12 comments

Comments

@mdupreejr
Copy link

Docker vault setup gives error that vault cant connect to mongodb

@kevinzezel
Copy link

Same error here

1 similar comment
@juniorbts
Copy link

Same error here

@cedricve
Copy link
Member

cedricve commented May 26, 2023

Can you provide some context? Docker compose? Stand-alone docker?

@NikolaBoyko
Copy link

Hi, i have the same error.

@cedricve
Copy link
Member

@NikolaBoyko can you provide details of your setup?

@NikolaBoyko
Copy link

NikolaBoyko commented May 28, 2023

@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

@NikolaBoyko
Copy link

NikolaBoyko commented May 28, 2023

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

@cedricve
Copy link
Member

cedricve commented May 28, 2023

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"

cedricve added a commit that referenced this issue May 28, 2023
Provided a fix for: #10.
It looks like Kerberos Vault was launched before MongoDB was properly setup. We have now added a `healthcheck`, and `depends_on` validation.
@cedricve
Copy link
Member

cedricve commented May 28, 2023

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: cfc02d1. 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?

@NikolaBoyko
Copy link

I try wait mongo with wait.sh it did not help.
I try your fix tomorrow, thanks.

@NikolaBoyko
Copy link

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

@cedricve
Copy link
Member

hmm indeed might be the case! Waiting for other people to confirm fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants