getaddrinfo EAI_AGAIN error while using supabase-js client in nodejs
See original GitHub issueBug 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
- instantiate the supabase js client
- start making calls to supabase
- 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:
- Created 3 years ago
- Comments:11 (4 by maintainers)
In my case, this particular thread from AWS solved my FetchError - ECONNRESET issues
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