Skip to content

fix(weave): WEAVE_DEBUG_HTTP exception on server_info check#6137

Open
jamie-rasmussen wants to merge 1 commit intomasterfrom
jamie/fix-http-debug-logging
Open

fix(weave): WEAVE_DEBUG_HTTP exception on server_info check#6137
jamie-rasmussen wants to merge 1 commit intomasterfrom
jamie/fix-http-debug-logging

Conversation

@jamie-rasmussen
Copy link
Collaborator

Description

I was doing a WEAVE_DEBUG_HTTP=1 python3 test.py where test.py just imported weave and init'ed a project, and it was showing retries before throwing a RuntimeError:

...
weave: retry_attempt
---------------------
Time: 21:56:57.074538
Thread ID: 8366911616
Method: GET
URL: https://trace.wandb.ai/server_info
Headers:
  Host: trace.wandb.ai
  Accept: */*
  Accept-Encoding: gzip, deflate
  Connection: keep-alive
  User-Agent: python-httpx/0.28.1
  X-Weave-Retry-Id: 019c5a4b-54b2-7550-a7d9-8b6d82051d87
  Authorization: <Redacted>
Body:
  None
----- Response below -----
Elapsed Time: 0.07 seconds
Status Code: 200
Reason: OK
Headers:
  date: Sat, 14 Feb 2026 03:56:56 GMT
  server: uvicorn
  content-length: 77
  content-type: application/json
  via: 1.1 google
  alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Body:
weave: retry_failed
weave: Unexpected error when checking if Weave is available on the server.  Please contact support.
Traceback (most recent call last):
  File "/Users/jrasmussen/source/jcr/suprot_20260213/debug.py", line 3, in <module>
    weave.init("jamie-rasmussen/2026-02-13_test")
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/weave/trace/api.py", line 109, in init
    return weave_init.init_weave(
           ~~~~~~~~~~~~~~~~~~~~~^
        project_name,
        ^^^^^^^^^^^^^
    )
    ^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/weave/trace/weave_init.py", line 144, in init_weave
    raise RuntimeError(
        "Weave is not available on the server.  Please contact support."
    )
RuntimeError: Weave is not available on the server.  Please contact support.

This might have been broken by the switch to httpx in #5502 ?

Claude's analysis and fix is in this PR.

The problem: HTTPTransport.handle_request returns a response whose stream hasn't been consumed — that's normally the client layer's job. But pprint_response accesses response.text (which requires the body to be read), causing the
  ResponseNotRead exception. This exception then gets caught by tenacity's retry logic, which retries the request (and fails again the same way).
                                                                                                                                                                                                                                               
  The response.read() call eagerly consumes the response body at the transport level so the debug logging can inspect it. The response is still returned normally to the client afterwards since httpx caches the read content.

@jamie-rasmussen jamie-rasmussen requested a review from a team as a code owner February 14, 2026 04:04
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
weave/utils/http_requests.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wandbot-3000
Copy link

wandbot-3000 bot commented Feb 14, 2026

@jamie-rasmussen jamie-rasmussen force-pushed the jamie/fix-http-debug-logging branch from 9dc419c to 20ae9ba Compare February 17, 2026 15:14
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

Comments