algolia / algoliasearch-client-python

⚡️ A fully-featured and blazing-fast Python API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/python/?language=python
MIT License
196 stars 67 forks source link

First-time user: AlgoliaUnreachableHostException "Unreachable hosts" #531

Closed saper closed 3 years ago

saper commented 3 years ago

Description

Fresh signup (1st day of the trial), I tried to upload 12805518 byte RSS file into Algolia - getting exception:

algoliasearch.exceptions.AlgoliaUnreachableHostException: Unreachable hosts

Steps To Reproduce

A client:

from algoliasearch.search_client import SearchClient
import feedparser

def generate_id(obj):
    obj["objectID"] = obj["link"]
    return obj

client = SearchClient.create("XXXYAAAAAA", "11232132132132131231231232131231")
index = client.init_index("index-name1")
index.save_objects([
    generate_id(i)
    for i in feedparser.parse("12megabyte.xml")["entries"]
])

I have hot-patched the code to produce some diagnostics and it says:

RETRY Response(None, ('Connection aborted.', timeout('The write operation timed out')), "None")
RETRY Response(None, ('Connection aborted.', timeout('The write operation timed out')), "None")
RETRY Response(None, ('Connection aborted.', timeout('The write operation timed out')), "None")
RETRY Response(None, ('Connection aborted.', timeout('The write operation timed out')), "None")

and also:

algoliasearch.exceptions.AlgoliaUnreachableHostException: ('Unreachable hosts: %s', 'XXXYAAAAAA.algolia.net XXXYAAAAAA-1.algolianet.com XXXYAAAAAA-2.algolianet.com XXXYAAAAAA-3.algolianet.com')

Running this locally on my machine in my lab network (unlike https://github.com/algolia/algoliasearch-client-javascript/issues/1193 I have no outgoing network disabled), the all named hosts are prefectly reachable and open connections on port 443.

saper commented 3 years ago

To paraphrase:

It's not the network. There is a no way it's the network. It was the network

A firewall rule prevented large file upload. Sorry for noise.