goauthentik / goauthentik/authentik

Gunicorn throws error upon handling SIGINT

Open
#7,204 6 comments 1 reaction 0 assignees View on GitHub
bug bug/confirmed
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 1h
Merged PRs (30d)
644

Description

**Describe the bug**
When sending a SIGINT to the authentik server gunicorn throws an error.

**To Reproduce**
Steps to reproduce the behavior:

1. Start a shell inside an authentik Docker image
2. Run `dumb-init -- /lifecycle/ak server` and wait for the startup to finish successfully
3. Send a SIGINT to the process i.e. by using the keyboard (CTRL+c)
4. See error

**Expected behavior**
The process should exit without throwing an error.

**Logs**
```
{"event": "Handling signal: int", "level": "info", "logger": "gunicorn.error", "timestamp": 1697581130.2154722}
{"event": "Error while closing socket [Errno 9] Bad file descriptor", "level": "info", "logger": "gunicorn.error", "timestamp": 1697581130.2611558}
{"event": "Error while closing socket [Errno 9] Bad file descriptor", "level": "info", "logger": "gunicorn.error", "timestamp": 1697581130.261223}
{"event": "Worker exiting (pid: 39)", "level": "info", "logger": "gunicorn.error", "timestamp": 1697581130.3631873}
{"event": "Worker exiting (pid: 38)", "level": "info", "logger": "gunicorn.error", "timestamp": 1697581130.3642566}
{"event": "Shutting down: Master", "level": "info", "logger": "gunicorn.error", "timestamp": 1697581130.9277878}
```
**Version and Deployment (please complete the following information):**

- authentik version: 2023.8.3
- Deployment: helm

**Additional context**
This might be related to https://github.com/benoitc/gunicorn/issues/1877 however this issue should have already been fixed in the version that authentik is currently using.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.