2102 bugdocker docker compose stack not seeding kv with configs #2543
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!2543
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2543/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: #2104
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2104
Original created: 2025-12-11T06:41:17Z
Original updated: 2025-12-11T06:43:06Z
Original head: carverauto/serviceradar:2102-bugdocker-docker-compose-stack-not-seeding-kv-with-configs
Original base: main
Original merged: 2025-12-11T06:41: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 consumer initialization to retry on transient errors instead of exiting
Prevent zen consumer from restarting on initial KV watch event by skipping first sync
Add NATS context setup script and debugging tools to serviceradar-tools image
Update all service images to v1.0.67 and add comprehensive KV environment variables
Diagram Walkthrough
File Walkthrough
2 files
Implement resilient consumer initialization with retry logicSkip initial KV watch event to prevent restart loop2 files
Add NATS context configuration script for local debuggingBundle NATS context setup and debugging aliases for local tools3 files
Enable KV-backed config and update service images to v1.0.67Enable KV-backed config and update service images to v1.0.67Enable KV-backed configuration for poller stack agent service5 files
Update NATS context and certificate documentation in motdDocument KV seeding verification and expected watcher telemetryDefine KV seeding fix scope and impact analysisAdd Docker Compose KV bootstrap requirement specificationTrack implementation tasks for KV seeding fixImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2104#issuecomment-3640471855
Original created: 2025-12-11T06:41:52Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
CLI context misuse
Description: The script auto-creates and selects a NATS CLI context using filesystem TLS certs if
present, which could be misused interactively inside the tools container; ensure the
container does not mount broader host paths and that cert volumes are read-only as
configured.
setup-nats-context.sh [17-33]
Referred Code
Secrets exposure via env
Description: Multiple services expose detailed KV mTLS certificate file paths via environment variables
which may be logged by container runtimes or crash reporters; confirm logging and
diagnostics do not leak sensitive paths or contents and that volumes are mounted read-only
as configured.
docker-compose.yml [543-559]
Referred Code
🎫 #2102
each KV-managed service on first boot.
functioning.
boot.
clean environment and watcher telemetry shows expected services.
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: 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 logic logs failures but it is unclear if critical actions (e.g., consumer
connection state changes) are captured with sufficient audit context across the system.
Referred Code
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status:
Verbose output: The script echoes connection details and certificate paths which may be sensitive in some
environments; verify this is not user-facing or exposed beyond internal debugging.
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 env: Environment variables such as CNPG credentials and KV certificate paths are configured;
ensure these are not logged at any log level by services when CONFIG_SOURCE=kv is enabled.
Referred Code
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status:
Watcher logic: Skipping the first KV watch event may be correct, but verify that configuration
initialization and validation still handle empty or malformed initial states securely.
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/2104#issuecomment-3640476028
Original created: 2025-12-11T06:43:06Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Remove duplicate environment variable definition
In
docker/compose/poller-stack.compose.yml, theagentservice hasCONFIG_SOURCEdefined twice. Remove the second definition (
CONFIG_SOURCE=file) to ensure theintended
kvsetting is used.docker/compose/poller-stack.compose.yml [103-113]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a critical bug where a duplicate
CONFIG_SOURCEvariable would cause the service to usefileinstead ofkv, directly contradicting the PR's main objective.Update outdated image tag in documentation
Update the
serviceradar-toolsimage tag fromv1.0.65tov1.0.67in thedocker-setup.mddocumentation to match the version used elsewhere in the PR.docs/docs/docker-setup.md [154-161]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly points out an outdated image tag in the documentation, which could cause confusion or errors for users following the instructions. Updating it improves documentation accuracy and consistency with the PR's changes.