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
I am facing a similar issue as reported in this Past Issue - #30.
StackTrace -
raise AlgoliaUnreachableHostException("Unreachable hosts") in retryst)fNotExist": True})
END RequestId: 0d549eca-dd2e-4884-9f43-0548a6db3674
REPORT RequestId: 0d549eca-dd2e-4884-9f43-0548a6db3674 Init Duration: 0.46 ms Duration: 4491.58 ms Billed Duration: 4500 ms Memory Size: 1024 MB Max Memory Used: 1024 MB
{"errorMessage": "Unreachable hosts", "errorType": "AlgoliaUnreachableHostException", "stackTrace": [" File \"/var/task/main.py\", line 37, in lambda_handler\n scan_and_upload_to_algolia()\n", " File \"/var/task/ddb_utils.py\", line 72, in scan_and_upload_to_algolia\n update_templates_data_in_algolia(algolia_records)\n", " File \"/var/task/algolia_utils.py\", line 21, in update_templates_data_in_algolia\n res = templates_v4_index.save_objects(records, {\"autoGenerateObjectIDIfNotExist\": True})\n", " File \"/var/task/algoliasearch/search_index.py\", line 69, in save_objects\n response = self._chunk(\"addObject\", objects, request_options, False)\n", " File \"/var/task/algoliasearch/search_index.py\", line 527, in _chunk\n raw_responses.append(self._raw_batch(requests, request_options))\n", " File \"/var/task/algoliasearch/search_index.py\", line 534, in _raw_batch\n return self._transporter.write(\n", " File \"/var/task/algoliasearch/http/transporter.py\", line 35, in write\n return self.request(verb, hosts, path, data, request_options, timeout)\n", " File \"/var/task/algoliasearch/http/transporter.py\", line 72, in request\n return self.retry(hosts, request, relative_url)\n", " File \"/var/task/algoliasearch/http/transporter.py\", line 94, in retry\n raise AlgoliaUnreachableHostException(\"Unreachable hosts\")\n"]}%
Code Snippet
def create_algolia_client():
algolia_api_key = os.environ.get("INVIDEO_ALGOLIA_API_ID").strip()
algolia_api_id = os.environ.get("INVIDEO_ALGOLIA_API_KEY").strip()
if algolia_api_id is not "" and algolia_api_key is not "":
algolia_client = SearchClient.create(algolia_api_id, algolia_api_key)
logger.info("algolia search client created")
return algolia_client
else:
logger.error("algolia id and key is missing, failed to create insights client")
def update_templates_data_in_algolia(records):
algolia_client = create_algolia_client()
templates_v4_index = algolia_client.init_index("templates_v4")
res = templates_v4_index.save_objects(records, {"autoGenerateObjectIDIfNotExist": True})
logger.info("Got Response from Algolia", res)
I am running this code snippet inside AWS Lambda.
After reading the possible solutions in past Issue. I added urllib3, requests[security] and pyOpenSSL libraries.
Description
I am facing a similar issue as reported in this Past Issue - #30.
StackTrace -
Code Snippet
I am running this code snippet inside AWS Lambda.
After reading the possible solutions in past Issue. I added urllib3, requests[security] and pyOpenSSL libraries.
Here's the pyproject.toml -
We have performed following checks -
Steps To Reproduce
The text was updated successfully, but these errors were encountered: