Bad webhook error on start up
See original GitHub issueI just deployed this to Heroku and I think I got everything right but I’m getting an error when the app tries to start… telegram.error.BadRequest: Bad webhook
I’ve checked the URL as per the first line of output but there’s not many other clues… it’s running on a free dyno if that makes a difference?
app[web.1]: Running bot in webhook mode. Make sure that this url is correct: https://<app-name>.herokuapp.com/
app[web.1]: Error while bootstrap set webhook: Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443
app[web.1]: Failed bootstrap phase after 0 retries (Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443)
app[web.1]: unhandled exception in Bot:1782207609:updater
app[web.1]: Traceback (most recent call last):
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 236, in _thread_wrapper
app[web.1]: target(*args, **kwargs)
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 602, in _start_webhook
app[web.1]: ip_address=ip_address,
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 674, in _bootstrap
app[web.1]: bootstrap_interval,
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 530, in _network_loop_retry
app[web.1]: onerr_cb(telegram_exc)
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 652, in bootstrap_onerr_cb
app[web.1]: raise exc
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 516, in _network_loop_retry
app[web.1]: if not action_cb():
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/ext/updater.py", line 640, in bootstrap_set_webhook
app[web.1]: drop_pending_updates=drop_pending_updates,
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/bot.py", line 127, in decorator
app[web.1]: result = func(*args, **kwargs)
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/bot.py", line 2863, in set_webhook
app[web.1]: result = self._post('setWebhook', data, timeout=timeout, api_kwargs=api_kwargs)
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/bot.py", line 260, in _post
app[web.1]: f'{self.base_url}/{endpoint}', data=data, timeout=effective_timeout
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/utils/request.py", line 354, in post
app[web.1]: **urlopen_kwargs,
app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/telegram/utils/request.py", line 272, in _request_wrapper
app[web.1]: raise BadRequest(message)
app[web.1]: telegram.error.BadRequest: Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
python-telegram-bot.I already PORT 8443 but Error while ...
I already PORT 8443 but Error while bootstrap set webhook: Bad webhook: webhook can be set up only on ports 80, 88, 443...
Read more >Common Webhook Errors | SignalWire Developer Portal
Below are some examples of common errors that you might encounter when using webhooks. If you are unable to resolve your issue, you...
Read more >Anyone got telegram webhooks working? - Configuration
This is the error i got: telegram.error.BadRequest: 'Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or...
Read more >Guide for Troubleshooting GitHub Webhooks - Hookdeck
Another error that can occur with GitHub webhooks is a 400 HTTP error, which indicates a bad request. One thing to note when...
Read more >Help with 'Bad payload received' error when trying...
I have a flow that stores some variables. I want to output those variable to a Teams group. In Teams I have set...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Вот такая штука сработала (по мотивам https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks#heroku)
YES! It worked. Thanks, @stikhonchuk. Final commit: https://github.com/ohld/telegram-support-bot/commit/ab9638e9deb416bf86a28b72dda9d81273aa758f