Hi all,
I’m trying to deploy an already trained Rasa chatbot using docker-compose with Telegram integration. Previously, I’ve tested it using Ngrok to ensure that all Telegram-related parameters are good and I can send and receive messages through Telegram bot.
I also have a subdomain and a server. If I just install my rasa chatbot and run it on the server as is, it won’t work. I believe, this is due to the fact that server listens to 443 port, but Rasa listens on 5005.
This led me to going with Docker, because I can forward ports within compose file. This is how it looks like through docker ps -a:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
491d675545fc rasa/rasa:2.7.0-full "rasa run" About an hour ago Up 19 minutes 0.0.0.0:443->5005/tcp, :::443->5005/tcp ada_bot_rasa_1
Yet my bot is unreachable through Telegram. What can be the issue?
I’ve also run this:
curl https://api.telegram.org/bot$BOT_TOKEN/getWebhookInfo
And got this:
{"ok":false,"error_code":401,"description":"Unauthorized"}
Please help me figure out how to deploy my bot either with Docker, or without - I don’t really care at this stage, I just want it working on my server.
No, I do not. Because now I have a server with static ip and subdomain attached to it, so there is no need for ngrok type of emulation. I just mentioned ngrok to show that my bot worked with telegram on my local machine through ngrok, but it doesn’t work on my server.
No, I don’t have any certificates. Tutorial did not specify that I need one. Should certificate be somehow embedded in Rasa itself?
I did a quick glance on Let’sEncrypt tutorials, and it generally requires something like a web-server to serve the certificate. I don’t have that. This server is only for Rasa and rasa-related stuff. So how do I create a certificate and teach Rasa to use it?
And finally follow the instructions of the command line, it will look something like this:
rasa run --ssl-certificate my.pem --ssl-keyfile my.key --port 443
The --port 443 is an alternative to the forwarding port.
So I’ve managed to fix it without having to modify Telegram files. Issue is that self-signed certificates are simply not good enough, so you should use Let’sEncrypt and have those certificates as flag when starting Rasa.
Hi,
I have also created certificates for my subdomain. When curl from: https://api.telegram.org/bot$BOT_TOKEN/getWebhookInfo, I get result: 200 back. However, when I send a message in Telegram, the message does not go through. Have you had similar problems? I have an ubuntu vm on a server and rasa running in docker container there.
@nik202
Du you have any experiences how to attach SSL certificates? when I run ‘rasa run --ssl-certificate fullchain.pem --ssl-keyfile priv.key --endpoints endpoints_local.yml --credentials credentials_local.yml --connector addons.custom_channel.MyIO --debug’
I get: rasa/lib/python3.8/site-packages/rasa/server.py", line 437, in create_ssl_context
ssl_context.load_cert_chain(
FileNotFoundError: [Errno 2] No such file or directory
Although my certificates are in root directory. Thanks in advance!
Thanks for answering.
My workaround is now, that I have a NGINX-Reverseproxy, which loads the certificates and forwards the requests to the specific Docker container.