Skip to content

fix: disable weaviate-client PyPI version check that blocks health checks#394

Open
damianloch wants to merge 1 commit into
mainfrom
fix/weaviate-pypi-version-check
Open

fix: disable weaviate-client PyPI version check that blocks health checks#394
damianloch wants to merge 1 commit into
mainfrom
fix/weaviate-pypi-version-check

Conversation

@damianloch
Copy link
Copy Markdown
Contributor

@damianloch damianloch commented May 13, 2026

Summary

  • Pass skip_init_checks=True to all weaviate.connect_to_custom() and weaviate.connect_to_local() calls across the codebase
  • The weaviate-client v4 library fetches https://pypi.org/pypi/weaviate-client/json on every connection to check for newer versions, adding ~4 seconds of latency per connection
  • This causes the Docker health check (5s timeout) to consistently fail because the chatbot's /health/ probe creates a new WeaviateClient per WebSocket connection

Root Cause

The weaviate-client>=4.15.0 dependency 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, leaving aurora-server permanently unhealthy and blocking dependent containers (MCP).

Test plan

  • make dev completes without aurora-server health check failure
  • Weaviate queries (knowledge base, incident feedback, chatbot) still work correctly
  • Health check endpoint returns in <3s (vs previous ~6s)

Summary by CodeRabbit

  • Chores
    • Updated backend database client initialization configuration across multiple services to optimize connection setup behavior.

Review Change Stack

…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.
@damianloch damianloch requested a review from a team as a code owner May 13, 2026 12:54
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Walkthrough

The PR adds skip_init_checks=True to all Weaviate client connection instantiation calls across three backend modules: the chat agent service, incident feedback handler, and knowledge base service. The parameter is passed to both secure (connect_to_custom) and non-secure (connect_to_local) connection methods.

Changes

Weaviate Initialization Skip Checks

Layer / File(s) Summary
Add skip_init_checks=True to Weaviate client connections
server/chat/backend/agent/weaviate_client.py, server/routes/incident_feedback/weaviate_client.py, server/routes/knowledge_base/weaviate_client.py
The skip_init_checks=True parameter is added to weaviate.connect_to_custom() calls in the agent and knowledge base modules, and to both connect_to_custom() and connect_to_local() calls in the incident feedback module. This skips initialization validation during Weaviate client instantiation across all three services.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • beng360
  • OlivierTrudeau
  • Zarlanx

Poem

🐰 A hop through three files with a change so neat,
Skip those init checks, let the startup fleet,
Dance through Weaviate without a care,
One parameter, three modules, everywhere! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: disabling the weaviate-client version check via skip_init_checks=True parameter across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/weaviate-pypi-version-check

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between e32f6ff and 3c93c00.

📒 Files selected for processing (3)
  • server/chat/backend/agent/weaviate_client.py
  • server/routes/incident_feedback/weaviate_client.py
  • server/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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 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:


🏁 Script executed:

find . -name "weaviate_client.py" -type f

Repository: Arvo-AI/aurora

Length of output: 208


🏁 Script executed:

cat -n ./server/chat/backend/agent/weaviate_client.py | head -80

Repository: Arvo-AI/aurora

Length of output: 2131


🏁 Script executed:

cat -n ./server/routes/incident_feedback/weaviate_client.py | head -80

Repository: 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 -100

Repository: 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.

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.

1 participant