This error will come up if the credentials you are using (the Application ID and the API key) are incorrect. Therefore, we first recommend checking that the credentials you are using are correct.
Then, we recommend reviewing whether the application you are trying to connect to exists. If it does exist, you can verify the status of your cluster by going to our status page here.
You can monitor your server's status on your dashboard as well.
Configuration issues
If the application you are trying to connect to exists and the status page does not indicate issues on your cluster, it is likely to be a DNS or TCP issue. This is the case regardless of the application you are using.
Resource Issues
For backend indexing you can increase the ulimit size or pool the TCP connections.
When ulimit is not an option, http agent or http pooling (or a combination of ulimit + http agent) is the best next solution.
For nodejs
UV_THREADPOOL_SIZE
is useful.
Geographic Location
If you are serving a website on your server, that website will be accessed on users' browsers.
If the connection users make to Algolia is from the browser (a front end connection), and the issue is intermittent, the issue may be that users are too far from the Algolia servers to make a connection.
You can test this issue by asking your users to run this connection diagnostic https://community.algolia.com/diag/
If the connection users make to Algolia is from your servers (a back end connection), and the issue is intermittent, the issue is less likely to be an issue of geographic location, but there are other connection issues you can diagnose using the script here https://www.algolia.com/doc/api-client/troubleshooting/faq/php/?client=php#why-am-i-getting-impossible-to-connect-unable-to-connect-or-unreachable-hosts-errors