question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getaddrinfo EAI_AGAIN error while using supabase-js client in nodejs

See original GitHub issue

Bug report

Describe the bug

I have a long running data collection server running which calls once every second or so to insert a new row into my database. Occasionally, supabase will respond with a node-fetch EAI_AGAIN error. This is the error output:

FetchError: request to https://<my_supabase_url>.supabase.co/rest/v1/data_collection_logs?id=eq.12 failed, reason: getaddrinfo EAI_AGAIN scpjtuqjxrphrqlsfwio.supabase.co
    at ClientRequest.<anonymous> (/home/andrew/Code/development/telebum3/data-collection-server/node_modules/.pnpm/node-fetch@2.6.1/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (node:events:376:20)
    at TLSSocket.socketErrorListener (node:_http_client:490:9)
    at TLSSocket.emit (node:events:376:20)
    at emitErrorNT (node:internal/streams/destroy:188:8)
    at emitErrorCloseNT (node:internal/streams/destroy:153:3)
    at processTicksAndRejections (node:internal/process/task_queues:80:21) {
  type: 'system',
  errno: 'EAI_AGAIN',
  code: 'EAI_AGAIN'

A clear and concise description of what the bug is. To the best of my knowledge, this is because the DNS server failed to properly resolve the supabase address. I do not know if this could have something to do with my laptop’s hostname resolver, or if it has to do with how supabase resolves the urls on the server side.

To Reproduce

  1. instantiate the supabase js client
  2. start making calls to supabase
  3. eventually one of those calls will hit this EAI_AGAIN error (sometimes it can be after the task has ran for hours)

Expected behavior

supabase should not error out on DNS lookups

Screenshots

N/A

System information

  • OS: Arch Linux
  • Browser (if applies) N/A
  • Version of supabase-js: 1.0.7
  • Version of Node.js: 15.3.0

Additional context

I am running this task off of a laptop over wifi for testing purposes, not on a dedicated server. It is possible this error would not be present on a dedicated server

I am unsure if supabase urls are supposed to be treated like secrets or not. Let me know if it is helpful to include my supabase project url (or if I shouldn’t)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
guicarocommented, Feb 21, 2021

In my case, this particular thread from AWS solved my FetchError - ECONNRESET issues

Also, if you’re using NodeJS, make sure that you have completed all asynchronous processing prior to returning from your request handler; otherwise, you may have a socket connection that is frozen (and subsequently thawed) across requests, which will often lead to a connection reset. Async processing in NodeJS is a frequent source of this type of error.

0reactions
kiwicopplecommented, Jan 31, 2022

hey @ShafSpecs - would you mind opening an issue in the storage-api repo with some steps to replicate? (or a demo/example) - https://github.com/supabase/storage-api

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the cause of the error 'getaddrinfo EAI_AGAIN'?
It's quite normal to get getaddrinfo EAI_AGAIN errors when performing a lot of requests on your server. Node.js itself doesn't perform any ...
Read more >
ERROR: getaddrinfo EAI_AGAIN db.fj*******ts.supabase.co
Hi all! In recent days, when triggering processes with the postgres node, the following error began to appear: ERROR: getaddrinfo EAI_AGAIN ...
Read more >
javascript – Whats the source of Error: getaddrinfo EAI_AGAIN?
If you get this error from within a docker container, e.g. when running npm install inside of an alpine container, the cause could...
Read more >
What's the cause of the error 'getaddrinfo EAI_AGAIN'?
EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error. My main question is...
Read more >
Failed to parse access token response: Error - Anycodings.com
Failed to parse access token response: Error: Error while making request: getaddrinfo EAI_AGAIN accounts.google.com:443.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found