Hi, big fan, hope you are all well.
I have a really weird issue with deployments.
I am running a telegram bot, which works fine locally (and on fly.io) if I do this:
Create app
deploy app (crashes, no secret)
add secret (works)
if I deploy a new version, the app crashes with:
/app/node_modules/telegraf/node_modules/node-fetch/lib/index.js:1505
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
^
FetchError: request to https://api.telegram.org/[REDACTED]:[REDACTED]/getMe failed, reason: connect EHOSTUNREACH 2001:67c:4e8:f004::9:443
at ClientRequest.<anonymous> (/app/node_modules/telegraf/node_modules/node-fetch/lib/index.js:1505:11)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:502:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'EHOSTUNREACH',
code: 'EHOSTUNREACH'
}
This error occurs ONLY if the telegram API is unreachable, which leads me to believe there is a race condition somewhere where the instance doesn’t (yet?) have no connectivity?
To reiterate, if I: delete app, create app, deploy (fails due to missing secret), add secret
it works without a hiccup.
If I then deploy a new version (same exact code) it produces the error above.
Any hint on what might be happening here?
Thanks