Repository navigation
fix: disable Gunicorn's control socket - #370
Merged
Merged
Conversation
Gunicorn 25.1 and later create a control socket for gunicornc in $XDG_RUNTIME_DIR or $HOME/.gunicorn and log "Control server error" at startup if that is not writable, as on the read-only root file system of the Helm chart. Start the petstore example's Gunicorn with --no-control-socket, as the app does not use it, do the same in the production Dockerfile example and document it for the chart. The kind install test now fails if the app logs errors. Closes #369 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR prevents Gunicorn 25.1+ from creating an unusable control socket in the read-only chart environment by updating the example image and deployment guidance, while strengthening the kind install workflow to fail on startup errors visible only in application logs. Sequence diagram for Gunicorn startup without a control socketsequenceDiagram
participant Pod
participant Gunicorn
participant App
Pod->>Gunicorn: start --no-control-socket
Gunicorn->>App: create_app()
Gunicorn-->>Pod: serve HTTP requests
Flow diagram for Kubernetes application log regression checkingflowchart TD
A[Install petstore chart] --> B[Collect app pod logs]
B --> C{grep Gunicorn or FOCA error format}
C -->|error found| D[Fail workflow]
C -->|no error found| E[Continue CI]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #370 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 2006 2006
=========================================
Hits 2006 2006
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
FOCA logs errors as "ERROR ]", not as Gunicorn's "[ERROR]". Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg
marked this pull request as ready for review
October 22, 2026 00:34
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/deployment.md" line_range="60" />
<code_context>
USER 1000
COPY ./ /app
-CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "4", "wsgi:create_app()"]
+CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "4", "--no-control-socket", "wsgi:create_app()"]
```
</code_context>
<issue_to_address>
**Shell example still emits socket error**
When the generic command is used to run Gunicorn in the chart’s read-only container, the generic Gunicorn command above the Dockerfile example still omits `--no-control-socket`, so users who use it in the chart’s read-only container get a control-server startup error in the app logs.
Add `--no-control-socket` to the generic command example, with the Gunicorn 25.1 version requirement noted.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: docs/deployment.md:60
The command-line example matches the Dockerfile example now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gunicorn 25.1 and later start a control server for
gunicorncand create its socket in$XDG_RUNTIME_DIRor$HOME/.gunicorn. On the read-only root file system of thefoca-commonchart, it logsControl server error: Read-only file system: '/home/foca/.gunicorn'at startup (found in the kind install test, #365).examples/petstore/Dockerfile: start Gunicorn with--no-control-socket(the app does not use the control interface; the image pins Gunicorn 26.2.0).docs/deployment.md: the production Dockerfile example does the same, with a "Things to keep in mind" bullet (needs Gunicorn 25.1 or later; older versions reject the flag).docs/helm-chart.md: the Gunicorn bullet says to disable the control socket in the image or viaextraArgs..github/workflows/charts.yml: the kind install job now fails if the app's pods log errors (Gunicorn's[ERROR]or FOCA'sERROR ]format), as a regression check for this and similar errors that don't fail the install.The chart does not add
--no-control-socketitself: it can't know the image's Gunicorn version, and Gunicorn before 25.1 exits on the unknown flag. Apps can already pass it via<valuesKey>.gunicorn.extraArgs.Light lane: only changes the example image's command (configuration), docs and a CI check (no secrets, permissions or release workflows); no reviewer subagents, no 15-minute Sourcery wait.
Verification
HOME(HOME=/proc): without the flag,[ERROR] Control server error: ... '/proc/.gunicorn'; with--no-control-socket, no error.--no-control-socketexists in Gunicorn 25.1.0, 25.2.0, 25.3.0, 26.0.0, 26.2.0, not in 24.1.1 or 25.0.0 (gunicorn --help).actionlint(with shellcheck) oncharts.yml: clean;git diff --check: clean.mkdocs build --strict: passes.Open questions
None.
Closes #369
🤖 Generated with Claude Code
Summary by Sourcery
Disable Gunicorn's unused control socket in deployment guidance and strengthen chart CI checks for startup errors.
Bug Fixes:
Enhancements:
CI: