Repository navigation
fix(compose): restore Vector log writes and unbreak prod compose validation (#1799) - #1800
Merged
Merged
Conversation
…dation (#1799) Two independent compose defects, both silent, both found while diagnosing a Docker daemon wedge caused by a full disk. 1. Vector has discarded ALL log output since #1478 (v0.8.0) #1478 chowns /data/logs to 1000:1000 (chmod 775) so the UID-1000 backend's retention sweep can delete archived originals. But the vector service runs as root with cap_drop: ALL, which strips CAP_DAC_OVERRIDE — the capability that lets root ignore file permissions. Root is neither the owner (1000) nor in the group (1000), so it falls through to "other" (r-x) on a 775 dir and every sink write fails: ERROR sink{component_id=local_logs component_type=file}: Unable to open the file. path=b"/data/logs/local-2026-07-27.json" error=Permission denied (os error 13) This is silent because a file-sink error does not fail Vector's healthcheck, which only probes the :8686 API — the container reports healthy while writing nothing. On the instance where this was found, /data/logs had no new files between 2026-07-09 and 2026-07-27. Fixed with group_add: ["1000"], which uses the directory's existing group-write bit rather than restoring a capability, so the cap_drop posture is preserved. Vector must stay root for the uid: raw container logs under /var/lib/docker/containers are 0640 root:root, so user: "1000:1000" would swap a write failure for a read failure. 2. docker-compose.prod.yml failed schema validation and hid a conflicting retention default backend.environment is a YAML list, and two separate #1039-class "mirror docker-compose.yml" fixes each appended the same LOG_* trio. That broke the file two different ways: - LOG_ARCHIVE_ENABLED and LOG_CLEANUP_HOUR were byte-identical across both blocks. Compose requires array items to be unique, so the file did not parse at all: validating docker-compose.prod.yml: services.backend.environment array items[67,112] must be unique - LOG_RETENTION_DAYS was duplicated with a DIFFERENT value (5 vs 90). Differing strings are not caught by the uniqueness check, so deduping only the identical pair would fix the parse error and leave this in place. Docker resolves a repeated env key by last-wins, so prod would silently run 90 while its own earlier block, docker-compose.yml, and config.py (COMMUNITY_RETENTION_FLOOR_DAYS = 5) all say 5. The conflict direction keeps 18x more rather than deleting early, so unlike #1638 this is a disk-growth bug, not data loss — but log_archive_service only deletes originals older than the window, making it a large contributor to unbounded growth. Removed the later duplicate block; kept the one matching docker-compose.yml and the code default, folding its LOG_ARCHIVE_PATH rationale into the survivor. Compose-only: no schema change, no migration, no code change, no new config surface. Existing deployments pick up the Vector fix on the next docker compose up -d (its service config changed, so it is recreated). Verification: docker compose -f docker-compose.yml config -> VALID docker compose -f docker-compose.prod.yml config -> VALID (was: parse error) both resolve vector.group_add=['1000'], cap_drop=['ALL'], user=root both resolve backend LOG_RETENTION_DAYS=5 (prod was silently 90) live: 0 permission errors, /data/logs writing again after 18 days silent Closes #1799
|
Resolve by running |
vybe
approved these changes
Jul 27, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
Validated via /validate-pr: compose-only fix for #1799 — dedupes the LOG_* trio (restores prod compose validation, resolves the 5-vs-90 retention conflict in favor of the documented community floor) and grants Vector GID 1000 group-write instead of restoring CAP_DAC_OVERRIDE (cap_drop posture preserved). Infra change justified in-diff. Security scan clean.
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.
Fixes two independent, silent compose defects found while diagnosing a Docker daemon wedge caused by a full disk.
Compose-only — no schema change, no migration, no code change, no new config surface.
Closes #1799
1. Vector has discarded ALL log output since #1478 (v0.8.0)
Affects both
docker-compose.ymlanddocker-compose.prod.yml.logs-initchowns/data/logsto1000:1000/775so the UID-1000 backend's retention sweep can delete archived originals (#1478). Butvectorruns as root withcap_drop: ALL, which stripsCAP_DAC_OVERRIDE— the capability that lets root bypass file permission checks. Root is neither the owner (1000) nor in the group (1000), so it falls through to other on a775dir:r-x, no write bit.Every sink write fails:
Why it went unnoticed for ~3 weeks: a file-sink error does not fail Vector's healthcheck, which only probes the
:8686API. The container reportshealthywhile writing nothing. On the instance where this surfaced,/data/logshad no new files between 2026-07-09 and 2026-07-27 — every platform and agent log in that window is unrecoverable.Pre-#1478 files are
root:root, which is why this only started when the directory ownership changed.Fix
group_add: ["1000"]onvector.Two deliberate choices worth reviewing:
group_add, notcap_add: [DAC_OVERRIDE]— uses the directory's existing group-write bit rather than restoring a capability, so thecap_drop: ALLposture (Invariant Client/Viewer User Role (AUTH-002) #17 territory) is preserved./var/lib/docker/containers/*/*-json.logare0640 root:root, souser: "1000:1000"would trade a write failure for a read failure.2.
docker-compose.prod.ymlfailed schema validation and hid a conflicting retention defaultbackend.environmentis a YAML list, and two separate "#1039 packaging gap" fixes each appended the same trio:Two distinct problems, only one visible:
2a — hard failure.
LOG_ARCHIVE_ENABLEDandLOG_CLEANUP_HOURare byte-identical in both blocks. Compose requires array items to be unique, so the file does not parse:2b — silent semantic conflict.
LOG_RETENTION_DAYSis also duplicated, but5vs90. Because the strings differ, the uniqueness check does not flag it — fixing 2a by deduping only the identical pair would leave this in place. Docker resolves a repeated env key by last-wins, so prod silently runs90while block A,docker-compose.yml, andconfig.py(COMMUNITY_RETENTION_FLOOR_DAYS = 5) all say 5.The conflict direction keeps 18× more rather than deleting early, so unlike #1638 this is a disk-growth bug, not data loss. It still matters:
log_archive_serviceonly deletes originals older than the window, so a 90-day window is a large unbounded-growth contributor — the same failure mode that wedged the daemon here.Fix
Removed block B; kept block A (matches
docker-compose.ymland the code default), folding B'sLOG_ARCHIVE_PATH-omission rationale into A's comment.Verification
Live on the affected instance after applying the Vector fix:
Deployment note
Existing deployments pick up the Vector fix on the next
docker compose up -d— its service config changed, so Vector is recreated automatically. No action needed beyond a normal deploy. Logs already dropped are not recoverable.Out of scope
The same investigation found that no compose service or SDK-created agent container sets any
logging:/log_config, so container logs grow unbounded — the root cause of the full disk. That fix is deliberately kept out of this PR to keep it reviewable, and will be filed separately.🤖 Generated with Claude Code