Skip to content

fix: replace qdrant healthcheck with perl io::socket instead of bash /dev/tcp#704

Open
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/qdrant-healthcheck-curl
Open

fix: replace qdrant healthcheck with perl io::socket instead of bash /dev/tcp#704
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali:fix/qdrant-healthcheck-curl

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

Problem

The Qdrant healthcheck used bash /dev/tcp, which is fragile and hangs on some systems. The fix uses Perl IO::Socket::INET with proper timeouts and IPv4 (127.0.0.1 instead of localhost).

Solution

Replaced the bash healthcheck command with a Perl script that connects to port 6333, sends an HTTP GET request, and checks for status 200. Added 127.0.0.1 (IPv4-safe) and removed the shell layer (CMD instead of CMD-SHELL).

Testing

Verified Perl is available on qdrant/qdrant:v1.16.3 and tested against a live container. Manual test: docker compose up with qdrant and verify healthcheck transitions from starting to healthy.

Copy link
Copy Markdown
Collaborator

@Lightheartdevs Lightheartdevs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Audit Review

The intent is right — bash /dev/tcp is fragile and a bashism. But the replacement has issues.

Problem 1: Perl may not be available in the qdrant image

qdrant/qdrant:v1.16.3 is a minimal Rust binary image. There is zero precedent for perl healthchecks in the codebase (0 uses across 65+ compose files). The established patterns are:

  • curl -sf (14+ services)
  • wget --spider (fallback)
  • python3 urllib (Python-based images)

Problem 2: Wrong health endpoint

Both the old and new healthcheck probe /healthz, but:

  • The manifest declares health: /
  • The health check phase (12-health.sh) probes /
  • The qdrant README documents GET / as the health endpoint

Suggested fix

Verify what tools are available in the qdrant image (curl, wget, or perl), then use the correct endpoint:

# If curl is available:
test: ["CMD", "curl", "-sf", "http://127.0.0.1:6333/"]
# If only wget:
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:6333/"]

The 127.0.0.1 change (replacing localhost) is good regardless — keeps that part.

…mage)

The qdrant/qdrant:v1.16.3 image ships with perl but no bash, curl, or
wget. The previous healthcheck used bash /dev/tcp which fails silently.
Also corrects the endpoint from /healthz to / (the documented qdrant
health endpoint) and uses 127.0.0.1 instead of localhost to avoid
IPv6 resolution issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yasinBursali yasinBursali force-pushed the fix/qdrant-healthcheck-curl branch from f96c72a to ae5eed0 Compare April 2, 2026 19:51
@yasinBursali
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've addressed both concerns:

1. Tool availability — perl is the only option

I tested the actual production image:

$ docker run --rm --entrypoint sh qdrant/qdrant:v1.16.3 -c "which curl; which wget; which perl"
/usr/bin/perl

$ docker run --rm --entrypoint perl qdrant/qdrant:v1.16.3 -e 'use IO::Socket::INET; print "ok\n"'
ok

qdrant/qdrant:v1.16.3 has no curl, no wget — only /usr/bin/perl with IO::Socket::INET. Perl is the only viable approach for this image. This follows the codebase pattern of using whatever runtime the image provides (python3 for whisper/litellm, wget for searxng/n8n, node for perplexica, etc.).

2. Endpoint fixed: /healthz/

Changed to match all three authoritative sources:

  • manifest.yamlhealth: /
  • 12-health.shSERVICE_HEALTH[qdrant]:-/
  • Qdrant documentation → GET / returns version info with HTTP 200

3. IPv4 preserved127.0.0.1 instead of localhost (unchanged from previous version).

Verified:

  • docker compose config --quiet passes
  • IO::Socket::INET confirmed available in production image
  • $$ escaping correct for Docker Compose → shell → perl chain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants