Skip to content

Proposal to fix LDAP crashes #14

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Proposal to fix LDAP crashes #14

wants to merge 1 commit into from

Conversation

WillNilges
Copy link
Member

When opening plug for the first time in a few hours, the app will sometimes fail to connect to LDAP, and the pod will crash. This will require the pod to wait a bit and attempt re-connection several times before doing so.

Closes #4

for err != nil {
if attempts < maxReconnectionAttempts {
c.app.db.AddLog(0, "ldap bind error: "+err.Error())
log.Info(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno if log has this but if there's a log.Error you should use that so error logs are printed to stderr

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, brain, I totally didn't bother to look this up at 3AM

@WillNilges
Copy link
Member Author

I don't think this even fixed the issue. I saw it die again. Gonna have to look at the code again.

[root@okd4-services ~]# oc logs -f plug-api-dockerfile-dev-8685c4f478-r8vk2
time="2022-03-21T15:47:00Z" level=info msg=/auth/login
time="2022-03-21T15:47:00Z" level=info msg="Starting server..."
[GIN] 2022/03/21 - 15:48:28 | 200 |  151.466399ms |    129.21.49.25 | GET      /upload
[GIN] 2022/03/21 - 15:48:28 | 304 |     427.918µs |    129.21.49.25 | GET      /static/plug.css
time="2022-03-21T18:42:28Z" level=info msg="cookie not found"
[GIN] 2022/03/21 - 18:42:28 | 302 |     419.956µs |    129.21.49.25 | GET      /
[GIN] 2022/03/21 - 18:42:28 | 302 |     131.366µs |    129.21.49.25 | GET      /auth/login?referer=/
[GIN] 2022/03/21 - 18:42:46 | 302 |  213.340811ms |    129.21.49.25 | GET      /auth/redir?referer=/&state=adlijaXLHWq%C3%B0%C3%A6%C2%AC%C2%B0QWHdQSLKDQ*%40&session_state=02805ec3-f973-4602-95ae-1690a94e1395&code=99bdaea5-096d-4457-be07-0ad9f6ad5dbc.02805ec3-f973-4602-95ae-1690a94e1395.a65ffef4-3a41-48c6-b1b1-2cb612a6f0fe
[GIN] 2022/03/21 - 18:42:46 | 302 |     405.433µs |    129.21.49.25 | GET      /
time="2022-03-21T18:42:47Z" level=fatal msg="LDAP Result Code 200 \"Network Error\": ldap: connection closed"

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.

502 on first load
2 participants