Bug/docker compose not creating db #2539
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!2539
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2539/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: #2098
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2098
Original created: 2025-12-10T19:01:06Z
Original updated: 2026-01-28T21:47:17Z
Original head: carverauto/serviceradar:bug/docker_compose_not_creating_db
Original base: main
Original merged: 2025-12-10T21:00:00Z 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
Description
Upgrade CNPG image to 16.6.0-sr3 with stable TimescaleDB 2.24.0
Remove version override hack forcing 2.24.0-dev in build
Add cert-generator dependency to docker-compose services
Disable retention policy creation in migrations as workaround
Diagram Walkthrough
File Walkthrough
7 files
Remove TimescaleDB version override in buildUpdate CNPG image tag and add dependenciesUpdate CNPG image tag and add dependenciesUpdate CNPG image tag to 16.6.0-sr3Update CNPG image reference in buildUpdate CNPG image reference in buildDisable all retention policy creation calls4 files
Update CNPG image tag in push targetsUpdate CNPG image tag and SHA digestUpdate CNPG image tag and SHA digestUpdate CNPG image tag and SHA digest5 files
Update CNPG image reference in documentationUpdate CNPG image reference in documentationDocument root cause and fix for TimescaleDB bugAdd requirements for stable TimescaleDB releasesDocument completed tasks for version fixImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2098#issuecomment-3638545503
Original created: 2025-12-10T19:01:43Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 No ticket provided
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: 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: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
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:
Audit retention disabled: Newly added lines disable TimescaleDB retention policies for many audit-relevant tables
(e.g., events, logs, service_registration_events), which may impact the ability to retain
and reconstruct audit trails unless alternative retention or archival exists.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Disabled safeguards: The PR comments out retention policy creation across multiple hypertables as a workaround
for crashes, which defers an edge-case handling strategy without providing alternative
safeguards or migration-time checks for policy existence.
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/2098#issuecomment-3638549926
Original created: 2025-12-10T19:03:01Z
PR Code Suggestions ✨
Explore these optional code suggestions:
The PR disables retention policies, contradicting the fix's goal
The PR's fix for a database migration crash is flawed because it disables all
retention policy creation in the SQL migration file. This workaround introduces
a significant regression that will cause unbounded data growth and should be
reverted.
Examples:
pkg/db/cnpg/migrations/00000000000001_schema.up.sql [34]
pkg/db/cnpg/migrations/00000000000001_schema.up.sql [52]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 10
__
Why: The suggestion correctly identifies a critical flaw where the PR claims to fix retention policy creation but instead disables it entirely, which is a major regression causing unbounded data growth.
Re-enable disabled data retention policies
Re-enable the
add_retention_policy()calls in the SQL migration script. Thesewere commented out but should be active now that the underlying bug is fixed by
the new CNPG image.
pkg/db/cnpg/migrations/00000000000001_schema.up.sql [33-599]
[To ensure code accuracy, apply this suggestion manually]Suggestion importance[1-10]: 10
__
Why: This suggestion correctly identifies that the PR's primary goal of fixing retention policies is undermined by leaving the
add_retention_policy()calls commented out, which would lead to a critical data growth issue.Ensure service waits for dependency completion
In
docker-compose.podman.yml, modify thedepends_onfor thecnpgservice to waitfor
cert-generatorto complete successfully, preventing a race condition.docker-compose.podman.yml [19-20]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a potential race condition in
docker-compose.podman.ymland proposes a fix that aligns it withdocker-compose.yml, preventing likely startup failures and improving service reliability.