i have an issue with telegram webhook. All settings is correct, but when telegram send webhook on vercel, nothing happens and no any records on vercel logs.
Telegram webhook last error is : "last_error_message":"Wrong response from the webhook: 401 Unauthorized"
Hi @mflash123, can you try triggering the webhook manually from Telegram’s side and observe the runtime logs for your application. Aer you using some signed secret authentication inside your webhook code that might be failing and returning 401?
I can call webhook manually from Telegram, but I dont have any access to telegram side to see the full log.
There no any auth payload.
Telegram makes POST call on vercel which contains the uniq token.
Same configuration works on local ant on other serverless cloud products. So, this is no any code issue, 100% this is some issues between vercel and telegram.
I am sure, this is some IP restrictions, can you check them? @anshumanb
I find the problem, but hope you give me solution.
I find out what request Telegram sends on vercel and tryies make same request and get 401 from vercel.
Check it curl -X POST "https://ai-tm-fitness-gb8fy52dx-mflash123s-projects.vercel.app" -H "Content-Type: application/json"
So, in deployment section there is Domains - block
But I can access there only throught vercel auth.
How can i make this URL public? Or where I can get the public urls to deployments?
this seems like a preview deployment to me because it is asking me for authentication.
Yes, absolutely same problem with telegram webhook. is it possible to convert preview deployment to production?
The problem is, in main branch my stable version,.
In dev - new feature. I want test the dev and it deploys as a preview. And it caused the auth error
This issue is fixed, but i have a new one with same participants..
vercel cant make any request to Telegram. It is crashing with error Unhandled Rejection: FetchError: request to https://api.telegram.org/bot[REDACTED]:[REDACTED]/getMe failed, reason: Client network socket disconnected before secure TLS connection was established
Hi @mflash123, I’m glad you fixed the deployment protection issue.
About the new one, I think either the URL or something else is not working in your code. Are you able to run the same code locally? Does this code require a long running task? Maybe the Telegram API didn’t respond in time.
Can you try using some /ping endpoint from Telegram API that just confirms the connection?