IPv6 node addresses produce an invalid request URL
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, networking
Research direction
Start by reading Node.url() and Node.from_url(), since the issue identifies both as paths where IPv6 brackets are lost or omitted. Reproduce with the supplied URL and node dict examples, then check the client tests for node URL construction. Done when both configurations produce http://[::1]:8108 and the request no longer fails with httpx.InvalidURL.
Written by the indexing model from the issue text.
Description
A node with an IPv6 address can't be reached. Node.url() joins the host and port as {host}:{port} without enclosing an IPv6 literal in brackets, so every request fails with httpx.InvalidURL before it is sent.
Both ways of configuring a node are affected:
- A URL string such as
"http://[::1]:8108".Node.from_urltakes the host fromurlparse(url).hostname, which strips the brackets, so the host is stored as::1. - A node dict such as
{"host": "::1", "port": 8108, "protocol": "http"}.
Steps to reproduce
import typesense
client = typesense.Client({
"api_key": "xyz",
"nodes": ["http://[::1]:8108"],
"num_retries": 0,
})
print(client.api_call.node_manager.nodes[0].url())
client.operations.is_healthy()
Actual behavior
http://::1:8108
httpx.InvalidURL: Invalid port: ':1:8108'
Expected behavior
The client sends requests to http://[::1]:8108.
Environment
- typesense-python:
master(8727d2b) - httpx 0.28.1
- Dominant language
- Python
- Stars
- 247
- Forks
- 66
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 7
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from typesense/typesense-python
-
`MultiSearchResponse` type does not account for union search response shapePossibly taken @tharropoulos claimed this 171 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
typesense/typesense-python#128 ·
-
`documents.Documents.import_()` `batch_size` argument is ignored, type of `import_parameters` is missing `batch_size`Possibly taken @tharropoulos claimed this 244 days ago. Open
Difficulty 2/5 1-2 days Newbie friendliness 68/100
typesense/typesense-python#124 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
typesense/typesense-python#100 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
typesense/typesense-python#122 · 3 comments ·
-
[Bug] - DeprecationWarning on instantiation of ClientPossibly taken @tharropoulos claimed this 265 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
typesense/typesense-python#114 · 8 comments ·
All issues in typesense/typesense-python
Similar issues
-
[Bug]: Revit selector reads process ids 2000-2099 as years (flaky AgentClientTests.AYearOrAProcessIdSelectsTheHost)Possibly taken @Wurschdhaud claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
pyrevitlabs/pyRevit#3817 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4074 ·
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Helm chart: allow setting ingressClassName on the IngressPossibly taken @commarla claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
pgadmin-org/pgadmin4#10658 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100