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

Dex doesn't retry when database not available during start #3602

Open
3 tasks done
kaushikjeet opened this issue Jul 3, 2024 · 4 comments · May be fixed by #3701
Open
3 tasks done

Dex doesn't retry when database not available during start #3602

kaushikjeet opened this issue Jul 3, 2024 · 4 comments · May be fixed by #3701

Comments

@kaushikjeet
Copy link

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.

Version

2.32.0

Storage Type

Postgres

Installation Type

Binary, Custom container image

Expected Behavior

Dex should retry database connections instead failing to start if database not available. In container world its difficult to align pods startup sequence in distributed environment.

Actual Behavior

Dex failed to start if unable to connect with Postgres during start time. It error out with message "failed to initialize storage:"

Steps To Reproduce

  1. configure postgres connector with Dex.
  2. start Dex without bringing databases first.
  3. Dex will fail to start with error "failed to initialize storage:"

Additional Information

We have applications deployed over K3S, Dex is one of the pod having Postgres database connector. It seems to be mandatory have database available for Dex to start as it try to connect with Postgres and error out. It doesn't have logic to retry connection when failed.

Configuration

No response

Logs

failed to initialize storage:
@nabokihms
Copy link
Member

@kaushikjeet Yes, I believe there are many cases when Dex does not start because of external dependencies, such as other providers or databases. This is unwanted behavior, and it would be nice to have this issue fixed.

@kaushikjeet
Copy link
Author

@nabokihms , shall we try fix and create PR for this behaviour?

@nabokihms
Copy link
Member

Yeah, sure, go ahead. I believe this is a good improvement.

@MoeBensu MoeBensu linked a pull request Aug 17, 2024 that will close this issue
@MoeBensu
Copy link
Contributor

MoeBensu commented Aug 17, 2024

@nabokihms I put something together. PR should be ready for review.

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

Successfully merging a pull request may close this issue.

3 participants