Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with latest release of urllib3 (urllib3==2.2.2) #187

Closed
zhangkaien opened this issue Sep 11, 2024 · 2 comments
Closed

Fails with latest release of urllib3 (urllib3==2.2.2) #187

zhangkaien opened this issue Sep 11, 2024 · 2 comments
Labels
Area: Client Manually written code that fits in no other area Category: Question

Comments

@zhangkaien
Copy link

The last version of urllib3, 2.2.2
https://github.com/urllib3/urllib3/releases/tag/2.2.2

the error information is :
client.indices.stats(index=indices_name, metric='store')
File "python3.9/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped
return api(*args, **kwargs)
File "python3.9/site-packages/elasticsearch/_sync/client/indices.py", line 4412, in stats
return self.perform_request( # type: ignore[return-value]
File "python3.9/site-packages/elasticsearch/_sync/client/_base.py", line 423, in perform_request
return self._client.perform_request(
File "python3.9/site-packages/elasticsearch/_sync/client/_base.py", line 271, in perform_request
response = self._perform_request(
File "python3.9/site-packages/elasticsearch/_sync/client/_base.py", line 316, in _perform_request
meta, resp_body = self.transport.perform_request(
File "/home/oes/.local/lib/python3.9/site-packages/elastic_transport/_transport.py", line 342, in perform_request
resp = node.perform_request(
File "/home/oes/.local/lib/python3.9/site-packages/elastic_transport/_node/_http_urllib3.py", line 167, in perform_request
response = self.pool.urlopen(
File "python3.9/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
File "python3.9/site-packages/urllib3/connectionpool.py", line 495, in _make_request
conn.request(
TypeError: request() got an unexpected keyword argument 'chunked'

@pquentin
Copy link
Member

Hello! I'm unable to reproduce, even with Python 3.9. elastic-transport-python supports urllib3 2.x since version 8.10 released last year: #121. (Disclaimer: I'm also a maintainer of urllib3.)

While the traceback line numbers do confirm you're using recent versions of elasticsearch-py, elastic-transport-python and urllib3, this is surprising:

File "/home/oes/.local/lib/python3.9/site-packages/elastic_transport/_node/_http_urllib3.py", line 167, in perform_request
response = self.pool.urlopen(
File "python3.9/site-packages/urllib3/connectionpool.py", line 789, in urlopen
 response = self._make_request(

Is it expected that the file became "python3.9/site-packages/urllib3/connectionpool.py" without "/home/oes/.local/lib/" in front?

Can you please share the output of pip list?

I would also suggest creating a minimal example that reproduces the issue inside a clean virtual environment.

@pquentin
Copy link
Member

Closing as I've not heard back from you, and I believe everything is working on our side. Thank you.

@pquentin pquentin added Area: Client Manually written code that fits in no other area Category: Question labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Client Manually written code that fits in no other area Category: Question
Projects
None yet
Development

No branches or pull requests

2 participants