Error with Firebase indexing: ENOTFOUND



Shared by @maxjoas.mj:

I get the following error message in my firebase function log:

Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions

and then I get this:

AlgoliaSearchNetworkError: getaddrinfo ENOTFOUND
at ClientRequest.error (/user_code/node_modules/algoliasearch/src/server/builds/node.js:229:14)
at ClientRequest.g (events.js:292:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:324:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at connectErrorNT (net.js:1034:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)


I think I see the bottom cause of your problem: Google’s Cloud Functions can not access the internet unless you enable Billing on your Google Cloud account. This means Firebase will prevent you to connect to Algolia until you add some billing info, which they could use to charge you if you go over their free tier.

I’d recommend to either:

  • Go with Firebase, adding billing details, and being extra careful of not going over their free plan as they might charge you for that
  • Use another serverless solution (e.g. Heroku) to run your back-end without needing to put a credit card.

In both cases, once you have functions running that can access the internet, sending index requests to Algolia should work as expected.