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

fix: Lazy initialize OIDC client #947

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

darktohka
Copy link
Contributor

@darktohka darktohka commented Nov 18, 2024

Sometimes, Planka might boot before the OIDC server is ready to respond. In this case the bootup will freeze with an error:

planka-1         |2024-11-18 08:01:14 [E] Failed to lift app: Error: getaddrinfo ENOTFOUND auth.tohka.us

In this state the server is not "running", but it also does not exit, leading to a server hang.

Instead, create the client on first OIDC request (lazy loading). If the OIDC client communication fails, the server will still be running but OIDC related requests (login, configuration) will fail with a 500 Internal Server Error and a log explaining the OIDC error:

planka-1         |2024-11-18 09:06:39 [W] Error while initializing OIDC client: Error: getaddrinfo ENOTFOUND auth.tohka.us
planka-1         |2024-11-18 09:06:39 [E] Sending 500 ("Server Error") response

This ensures that users who are already logged in can continue to use Planka, and the client will be created automatically when the OIDC client starts back up again and a request to use OIDC is sent.

@CLAassistant
Copy link

CLAassistant commented Nov 18, 2024

CLA assistant check
All committers have signed the CLA.

@meltyshev meltyshev merged commit 2632edb into plankanban:master Nov 18, 2024
1 check passed
@meltyshev
Copy link
Member

Thanks for the 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

Successfully merging this pull request may close these issues.

3 participants