fix: disable weaviate-client PyPI version check that blocks health checks#394
fix: disable weaviate-client PyPI version check that blocks health checks#394damianloch wants to merge 1 commit into
Conversation
…ecks The weaviate-client v4 library fetches https://pypi.org/pypi/weaviate-client/json on every connect_to_custom()/connect_to_local() call to check for newer versions. This adds ~4s to every WeaviateClient initialization, causing the Docker health check (5s timeout) to fail since the chatbot creates a new client per WebSocket connection. Pass skip_init_checks=True to all weaviate connection calls to eliminate the network round-trip.
WalkthroughThe PR adds ChangesWeaviate Initialization Skip Checks
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/chat/backend/agent/weaviate_client.py`:
- Line 40: Replace the bare assert used after creating the Weaviate client
(where skip_init_checks=True is passed) with a try/except that mirrors the
pattern used in the incident_feedback and knowledge_base Weaviate clients: wrap
the client creation and the subsequent client.is_ready() check in a try block,
catch exceptions, log detailed errors via the same logger used elsewhere
(include the exception text), and implement the same retry/backoff logic used in
those files before failing; ensure you remove the assert and use explicit
exception raising or error return on repeated failures so production runs are
not dependent on assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 33509111-2af4-41a6-a31b-0108fdb83ea6
📒 Files selected for processing (3)
server/chat/backend/agent/weaviate_client.pyserver/routes/incident_feedback/weaviate_client.pyserver/routes/knowledge_base/weaviate_client.py
| grpc_port=int(os.getenv("WEAVIATE_GRPC_PORT", "50051")), | ||
| grpc_secure=weaviate_secure, | ||
| headers=headers, | ||
| skip_init_checks=True, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
weaviate-client Python skip_init_checks parameter documentation version 4.21
💡 Result:
The skip_init_checks parameter in the weaviate-client Python library (version 4.21.0, released 2026-04-23 [1][2]) is a boolean option available in the WeaviateClient and WeaviateAsyncClient constructors, as well as various weaviate.connect helper functions like connect_to_local, connect_to_wcs, and connect_to_custom [3][4][5][6][7]. When set to True, it skips all initialization checks, including verifying that the Weaviate instance has started and is ready to accept requests. This is particularly useful for air-gapped environments (no internet access) and high-performance setups where checks add unnecessary overhead [3][4][5]. Example usage in constructor: client = weaviate.WeaviateClient( connection_params=..., skip_init_checks=True ) In connect helpers (recommended for v4): client = weaviate.connect_to_local( skip_init_checks=True ) Note: With skip_init_checks=True, the connect() method (if called) will not perform runtime checks [3][4]. The parameter has been present since early v4 versions and remains unchanged in 4.21.x, with related bugfixes (e.g., compatibility issues fixed) [8]. Official docs for v4.21 may be at https://weaviate-python-client.readthedocs.io/en/v4.21.0/ (inferred from pattern [5][9]), but stable/latest points to v4.20.x equivalents [4][5]. PyPI confirms v4.21.0 exists [10][1].
Citations:
- 1: https://pypi.org/project/weaviate-client/
- 2: https://pypi.org/
- 3: https://weaviate-python-client.readthedocs.io/en/v4.4.4/weaviate.client.html
- 4: https://weaviate-python-client.readthedocs.io/en/stable/weaviate.html
- 5: https://weaviate-python-client.readthedocs.io/en/v4.20.4/weaviate.html
- 6: https://weaviate-python-client.readthedocs.io/en/stable/weaviate.connect.html
- 7: https://weaviate-python-client.readthedocs.io/en/v4.4.3/weaviate.connect.html
- 8: https://weaviate-python-client.readthedocs.io/en/latest/changelog.html
- 9: https://weaviate-python-client.readthedocs.io/en/stable/
- 10: https://pypi.org/project/weaviate-client/4.21.0/
🏁 Script executed:
find . -name "weaviate_client.py" -type fRepository: Arvo-AI/aurora
Length of output: 208
🏁 Script executed:
cat -n ./server/chat/backend/agent/weaviate_client.py | head -80Repository: Arvo-AI/aurora
Length of output: 2131
🏁 Script executed:
cat -n ./server/routes/incident_feedback/weaviate_client.py | head -80Repository: Arvo-AI/aurora
Length of output: 3075
🏁 Script executed:
cat -n ./server/routes/incident_feedback/weaviate_client.py | sed -n '80,150p'Repository: Arvo-AI/aurora
Length of output: 3614
🏁 Script executed:
cat -n ./server/routes/knowledge_base/weaviate_client.py | head -100Repository: Arvo-AI/aurora
Length of output: 3954
Replace the bare assert with proper try/except error handling and follow the pattern used in the other Weaviate client files.
The skip_init_checks=True parameter skips all initialization checks in weaviate-client, not just the PyPI version check—including verification that the Weaviate instance has started and is ready. While the subsequent is_ready() check on line 43 provides some validation, using a bare assert for error handling is unsafe in production code (can be disabled with python -O) and lacks proper logging.
The incident_feedback and knowledge_base weaviate_client files handle this more robustly by wrapping connection setup in try/except blocks with error logging and retry logic. Apply the same pattern here to ensure consistent error handling across all three clients.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@server/chat/backend/agent/weaviate_client.py` at line 40, Replace the bare
assert used after creating the Weaviate client (where skip_init_checks=True is
passed) with a try/except that mirrors the pattern used in the incident_feedback
and knowledge_base Weaviate clients: wrap the client creation and the subsequent
client.is_ready() check in a try block, catch exceptions, log detailed errors
via the same logger used elsewhere (include the exception text), and implement
the same retry/backoff logic used in those files before failing; ensure you
remove the assert and use explicit exception raising or error return on repeated
failures so production runs are not dependent on assertions.
Summary
skip_init_checks=Trueto allweaviate.connect_to_custom()andweaviate.connect_to_local()calls across the codebasehttps://pypi.org/pypi/weaviate-client/jsonon every connection to check for newer versions, adding ~4 seconds of latency per connection/health/probe creates a new WeaviateClient per WebSocket connectionRoot Cause
The
weaviate-client>=4.15.0dependency is unpinned. Fresh Docker builds (after cache bust) pulled v4.21.0 which does a PyPI version check on init. Combined with the Celery inspect call (~1s), the total health check time exceeds the 5s Docker timeout, leavingaurora-serverpermanently unhealthy and blocking dependent containers (MCP).Test plan
make devcompletes withoutaurora-serverhealth check failureSummary by CodeRabbit