I have my Telegram bot deployed to GCP cloud run. It works fine even when instances get scaled to 0 – when Telegram calls, the instance starts and the bot receives the updates.
But sometimes, in unknown circumstances:
- I send a message to the bot
- No requests I have in GCP
- The instances don’t scale
What’s interesting is that if I call the getWebhookInfo
method:
{
"ok": true,
"result": {
"url": "https://my-host/telegram/webhook",
"has_custom_certificate": false,
"pending_update_count": 0,
"max_connections": 40,
"ip_address": "35.000.00.000",
"allowed_updates": [
"message"
]
}
}
Then Telegram does send updates right after my call, kinda when I remind about myself. Imagine the case:
- No pending updates
- Write a message to the bot
- No requests, no logs, no events in GCP
- Wait a long period of N hours
- call
getWebhookInfo
- it returns pending update 1 and calls me
What can be wrong?
I don’t have any firewall rule other than default.
The certificate is okay as it’s managed by Google.
I tried with a static IP (load balancer) and w/o – same case.
I thought it’s about "allowed_updates": [ "message" ]
but no – it’s set now always and no updates.