qdrant / qdrant/qdrant-client

Add information about requested URL to UnexpectedResponse exception to simplify troubleshooting

Open Beginner friendly
#456 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.4k
Forks
304
Avg merge
2d 9h
Merged PRs (30d)
37

Description

If you specify an incorrect URL for the QdrantClient, and make a call to the server such as upsert the request will fail with an exception.

The exception does not specify which server it tried to call, only the response.

If for example, you specify the URL for a web server that is not the cluster server (e.g. one of the nodes) you can get an exception with HTTP status 404 "not found" like this when you call upsert:

qdrant_client.http.exceptions.UnexpectedResponse: Unexpected Response: 404 (Not Found)
Raw response content:
b'404 page not found\n'

To make troubleshooting configuration mistakes easier, it would be nice to include the actual URL in the exception.

Proposed Solution

The exception comes from the send function in api_client.py.

One solution would be to add an optional url field to UnexpectedResponse in exceptions.py and rewrite the UnexpectedResponse.for_response function to include the URL data from the request (the request is an optional field on response which is used to construct the exception).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the send function in api_client.py and the UnexpectedResponse implementation in exceptions.py, especially UnexpectedResponse.for_response. Trace how the response request is available, then ensure the resulting exception includes the requested URL when one is present. Done means configuration errors show the server URL alongside the response details.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.