You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently implemented the algoliasearch package into a flask app.
All worked fine on python 3.6 and lower, but now we need to update our base python image to 3.7.
The algoliasearch package is now failing in the app.
I've whittled the relevant app code down to essentially the following (hard coding the ID, key, and index):
from algoliasearch.search_client import SearchClient
client = SearchClient.create(ALGOLIA_ID, ALGOLIA_KEY)
index = client.init_index(ALGOLIA_INDEX)
results = index.search('foo')
index.search() produces the following stack trace:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base_async.py", line 55, in handle
self.handle_request(listener_name, req, client, addr)
File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base_async.py", line 108, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2091, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2076, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 271, in error_router
return original_handler(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 271, in error_router
return original_handler(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 467, in wrapper
resp = resource(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 84, in view
return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
resp = meth(*args, **kwargs)
File "/careers-api/app/career/resources.py", line 492, in get
results = index.search('foo')
File "/usr/local/lib/python3.7/site-packages/algoliasearch/search_index.py", line 257, in search
request_options
File "/usr/local/lib/python3.7/site-packages/algoliasearch/http/transporter.py", line 55, in read
return self.request(verb, hosts, path, data, request_options, timeout)
File "/usr/local/lib/python3.7/site-packages/algoliasearch/http/transporter.py", line 75, in request
return self.retry(hosts, request, relative_url)
File "/usr/local/lib/python3.7/site-packages/algoliasearch/http/transporter.py", line 85, in retry
response = self._requester.send(request)
File "/usr/local/lib/python3.7/site-packages/algoliasearch/http/requester.py", line 35, in send
r, timeout=requests_timeout
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 497, in send
chunked=chunked,
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 802, in urlopen
**response_kw,
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 651, in connect
assert_fingerprint=self.assert_fingerprint,
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 732, in _ssl_wrap_socket_and_match_hostname
cert_reqs=resolve_cert_reqs(cert_reqs),
File "/usr/local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 289, in create_urllib3_context
context.minimum_version = TLSVersion.TLSv1_2
File "/usr/local/lib/python3.7/ssl.py", line 502, in minimum_version
super(SSLContext, SSLContext).minimum_version.__set__(self, value)
File "/usr/local/lib/python3.7/ssl.py", line 502, in minimum_version
super(SSLContext, SSLContext).minimum_version.__set__(self, value)
File "/usr/local/lib/python3.7/ssl.py", line 502, in minimum_version
super(SSLContext, SSLContext).minimum_version.__set__(self, value)
[Previous line repeated 469 more times]
File "/usr/local/lib/python3.7/ssl.py", line 500, in minimum_version
if value == TLSVersion.SSLv3:
RecursionError: maximum recursion depth exceeded while calling a Python object
I've been kicking this issue around for a few weeks now, trying every patch version of python, every version of algoliasearch, random versoins of other packages all in the hopes of getting something more useful in the way of debugging information to no avail.
This seems to be a personal fight between algoliasearch and pythons std/lib. If I had to guess, I would blame the ssl module but I really am out of my league here.
Any insight anyone can provide here would be most appreciated.
Thanks.
The text was updated successfully, but these errors were encountered:
Hey, the v4 version of the api client support python >= 3.8.
Python 3.7 has reached end of life and will not be supported https://devguide.python.org/versions/
Description
We recently implemented the algoliasearch package into a flask app.
All worked fine on python 3.6 and lower, but now we need to update our base python image to 3.7.
The algoliasearch package is now failing in the app.
I've whittled the relevant app code down to essentially the following (hard coding the ID, key, and index):
index.search() produces the following stack trace:
requirements.txt
I've been kicking this issue around for a few weeks now, trying every patch version of python, every version of algoliasearch, random versoins of other packages all in the hopes of getting something more useful in the way of debugging information to no avail.
This seems to be a personal fight between algoliasearch and pythons std/lib. If I had to guess, I would blame the ssl module but I really am out of my league here.
Any insight anyone can provide here would be most appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: