2

I take that log when start my bot

2020-06-03 17:10:21,867 - telegram.ext.updater - ERROR - unhandled exception in Bot:1023524274:updater
Traceback (most recent call last):
  File "/home/maksym/project/univesal_queue_bot/lib/python3.7/site-packages/telegram/ext/updater.py", line 216, in _thread_wrapper
    target(*args, **kwargs)
  File "/home/maksym/project/univesal_queue_bot/lib/python3.7/site-packages/telegram/ext/updater.py", line 452, in _start_webhook
    self.httpd.serve_forever()
  File "/home/maksym/project/univesal_queue_bot/lib/python3.7/site-packages/telegram/utils/webhookhandler.py", line 52, in serve_forever
    self.http_server.listen(self.port, address=self.listen)
  File "/home/maksym/project/univesal_queue_bot/lib/python3.7/site-packages/tornado/tcpserver.py", line 151, in listen
    sockets = bind_sockets(port, address=address)
  File "/home/maksym/project/univesal_queue_bot/lib/python3.7/site-packages/tornado/netutil.py", line 174, in bind_sockets
    sock.bind(sockaddr)
PermissionError: [Errno 13] Permission denied
2020-06-03 17:10:22,893 - telegram.ext.dispatcher - CRITICAL - stopping due to exception in another thread

I use:

python 3.7 python-telegram-bot 12.7 nginx 16+ self-signed certificate

Maksym Shchedrov
  • 59
  • 1
  • 2
  • 8
  • Sounds like a configuration problem. Did you check the wiki regarding webhooks? https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks – SergioR Jun 04 '20 at 11:44
  • Please share more details about your configuration, including the entrypoint Python file. – chesnutcase Sep 21 '21 at 06:40

1 Answers1

0

python-telegram-bot by default starts the HTTP webhook server at port 80 (see source code).

In Linux, only elevated users can run processes that bind to sockets with port numbers below 1024. Either run your app as root (may be a bad idea depending on your setup) with sudo python yourbot.py) or allow Python to bind to privileged ports.

Otherwise, there might be another process already using that port.

chesnutcase
  • 500
  • 2
  • 7
  • 20