Problems with functions? ECONNREFUSED

Is someone else seeing

Error: connect ECONNREFUSED

related issues with their deployed functions?
Locally it works perfectly.

I have one function in particular that works on and off when I send requests to it.
Edit: it seems like this affect multiple (all I’ve tested so far) functions.

Here’s part of the axios error message I get

# Error: connect ECONNREFUSED
    # at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16) {
  # errno: -111,
  # code: 'ECONNREFUSED',
  # syscall: 'connect',
  # address: '',
  # port: 443,
  # config: {
    # transitional: {
      # silentJSONParsing: true,
      # forcedJSONParsing: true,
      # clarifyTimeoutError: false
    # },
    # adapter: [Function: httpAdapter],
    # transformRequest: [ [Function: transformRequest] ],
    # transformResponse: [ [Function: transformResponse] ],
    # timeout: 0,
    # xsrfCookieName: 'XSRF-TOKEN',
    # xsrfHeaderName: 'X-XSRF-TOKEN',
    # maxContentLength: -1,
    # maxBodyLength: -1,
    # validateStatus: [Function: validateStatus],
    # headers: {
      # Accept: 'application/json, text/plain, */*',
      # 'Content-Type': 'application/json',
      # 'User-Agent': 'axios/0.26.1',
      # 'Content-Length': 423
    # },

It would usually be helpful if you could share the relevant piece of code. But, I’m assuming, your trying to connect to relative URLs in your Axios call. If yes, you need to use Absolute URLs.

Normally I would yeah, but it doesn’t seem tied to one particular function rather where it’s called from.
Postman and my node.js server both fail, but when it’s called directly from the webpage it works fine.

Also, yes I use relative URLs but with a baseURL in the Axios config, which has never been a problem before.
The problem started last night and I haven’t made any changes to any of my Netlify functions for several days.

That’s even strange then. Unfortunately, we’d need some more concrete info. Could you let us know, the site, the name of the function and any more relevant information like how to trigger it?

Sure! Would it be fine if I sent it through the email support? It’s a private API.

Sure, that would do.

1 Like

I’ve sent it and referred to this issue. As a side note my uptimerobot for the website itself started timing out from around 5pm last night, last timeout was an hour ago.

The problem went away as mysteriously as it appeared, but if it’s still unclear what caused this problem I’d love to supply any data that may be helpful so this doesn’t happen again :+1:

it’s happening again. Please research now while it’s going on.

Responded in the helpdesk.

1 Like