Connection timeout when fetching endpoint from cron-triggered function

I’m encountering an issue with the functions in my app. I have deployed two API endpoints:

•	/api/workflows/cron: This endpoint is triggered by Vercel Cron every minute.
•	/api/workflow/sexecute: This endpoint is triggered by a fetch request from the /api/workflow/cron endpoint.

I’m experiencing a connection timeout error when the /api/workflows/cron endpoint attempts to fetch the /api/workflows/execute endpoint. However, calling the /api/workflows/execute endpoint directly works without any issues.

This is an example of request that has failed ( requestID ): ndnwq-1722688988089-ce9b91505686

Any advice on how to resolve this?

Hi, @barekliton!

Do you have any more logs that you can share? It’d be super helpful. :smile:

I’ve also linked a helpful resource on error codes.

And on serverless functions timing out:

Hi, there aren’t extra logs.

I can’t fetch an api from another api triggered by vercel cron.
The only error i get is the one i’ve linked

Any suggestion on how to move on?

Hi @pawlean ,
here’s additional logs:

Request id: vzxjl-1724968766089-5f2e7b719916

etch failed
    at node:internal/deps/undici/undici:13178:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [cause]: [Error: C0D49E42B57F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:355:
  ] {
    library: 'SSL routines',
    reason: 'wrong version number',
    code: 'ERR_SSL_WRONG_VERSION_NUMBER'
  }
}

Another error that i get ( same scenario, haven’t touched the code for a while )
Request ID: rqtxr-1724968526107-966aa520ec94

fetch failed
    at node:internal/deps/undici/undici:13178:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  [cause]: ConnectTimeoutError: Connect Timeout Error (attempted addresses: 76.76.21.93:443, 76.76.21.164:443)
      at onConnectTimeout (node:internal/deps/undici/undici:2331:28)
      at node:internal/deps/undici/undici:2283:50
      at Immediate._onImmediate (node:internal/deps/undici/undici:2315:13)
      at process.processImmediate (node:internal/timers:483:21)
      at process.callbackTrampoline (node:internal/async_hooks:130:17) {
    code: 'UND_ERR_CONNECT_TIMEOUT'
  }
}