AlgoliaSearchNetworkError

I’m connecting Algolia with a Firebase project I have. I’m using the Firebase Cloud Functions in order to keep my Algolia index synced with all changes that occur in my Firebase database. But whenever I call

index.saveObject(firebaseObject);

from inside my Firebase Cloud Functions, I get

AlgoliaSearchNetworkError: getaddrinfo ENOTFOUND 5sffby8as8-1.algolianet.com 5sffby8as8-1.algolianet.com:443

I can run the syncing operation just fine outside of Firebase Functions (just on my own machine). This code is run in a javascript file through node.js.

Any ideas or help?

Hi @nicholas.victoryofth, thanks for asking your question and sorry you’re running into trouble.

I don’t know Cloud Functions or GCP too well - is it possible it’s something with IP/network security blocking the outbound call? If the same code works locally that’s where I’d start to look.

2 Likes

Hey @nicholas.victoryofth , which is your current Firebase plan?

On their getting started guide they state the following:

Firebase projects on the Spark plan can make only outbound requests to Google APIs. Requests to third-party APIs fail with an error. For more information about upgrading your project, see Pricing.

Also you find an example on how to use Algolia inside Firebase Cloud Functions here:

2 Likes

Thanks! That was the reason – I hadn’t upgraded my pricing plan.

1 Like