2102 bugdocker docker compose stack not seeding kv with configs #2542
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2542
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2542/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #2103
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2103
Original created: 2025-12-11T06:35:53Z
Original updated: 2025-12-11T06:40:43Z
Original head: carverauto/serviceradar:2102-bugdocker-docker-compose-stack-not-seeding-kv-with-configs
Original base: main
Original merged: 2025-12-11T06:40:43Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Bug fix, Enhancement
Description
Enable KV-backed configuration in Docker Compose services to seed defaults into datasvc on first boot
Fix db-event-writer service to retry consumer connection instead of failing on startup
Prevent zen consumer from restarting on initial KV watch event (first sync)
Add NATS context setup script and debugging tools to serviceradar-tools image
Update all Compose services to use KV configuration source with proper mTLS credentials
Diagram Walkthrough
File Walkthrough
2 files
Implement retry loop for NATS consumer connectionSkip initial KV watch event to prevent restart2 files
Add NATS context configuration script for debuggingBundle NATS context setup and debugging tools3 files
Enable KV configuration source for all servicesEnable KV configuration source for podman variantEnable KV configuration for poller stack variant5 files
Update NATS context and certificate documentationDocument KV seeding verification and watcher telemetryDefine KV seeding fix proposal and requirementsAdd Docker Compose KV bootstrap specificationDocument implementation tasks and checklistImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2103#issuecomment-3640457919
Original created: 2025-12-11T06:36:29Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Insecure context overwrite
Description: The script auto-creates and selects a NATS CLI context using mTLS cert/key paths from
environment variables without validating permissions or prompting, which could
unintentionally overwrite an existing context and expose credentials usage if run in
shared environments.
setup-nats-context.sh [23-33]
Referred Code
🎫 #2102
KV updates.
first boot, matching Kubernetes behavior.
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Logging Context: New retry loop logs connection failures but it is unclear if critical actions elsewhere
include user/action context; diff does not show audit fields like user IDs or outcomes for
critical operations.
Referred Code
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status:
Secrets In Logs: Several services add KV and database connection environment variables; while no sensitive
values are printed in the diff, ensure runtime logs do not emit cert paths, keys, or DB
passwords as some tools/aliases echo certificate metadata.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2103#issuecomment-3640460388
Original created: 2025-12-11T06:37:37Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Remove duplicate environment variable definition
Remove the redundant
CONFIG_SOURCE=fileenvironment variable for theagentservice, as it overrides the intended
CONFIG_SOURCE=kvsetting.docker/compose/poller-stack.compose.yml [102-113]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a duplicated
CONFIG_SOURCEenvironment variable which would cause the service to ignore the intendedkvconfiguration source, thus fixing a bug.Use Docker Compose extension fields
Refactor the Docker Compose files to eliminate duplicated KV configuration. Use
YAML extension fields and anchors to define a common configuration block and
merge it into each service.
Examples:
docker-compose.yml [264-272]
docker-compose.yml [385-396]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies significant duplication of KV configuration environment variables across multiple services in the compose files, and proposing YAML anchors to centralize this configuration would substantially improve maintainability.
Update outdated image tag in documentation
Update the
serviceradar-toolsimage tag in the documentation fromv1.0.65tov1.0.67to match the version used elsewhere in the PR.docs/docs/docker-setup.md [154-161]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies an outdated image tag in a documentation command, which improves the accuracy and usability of the setup instructions.