RASA problem connecting to Telegram

Hello.

I had build a Bot in RASA and deployed it on AWS.

Now i want to connect with Telegram so i follow this Tutorial:

I have my acces_token and verify but i dont know whats is my url, tried with http://localhost:5005, my Public IP Adress in AWS and dont work.

“https://your_url.com/webhooks/telegram/webhook”

I Run Rasa and stuck in:

2019-10-09 01:54:04 INFO root - Starting Rasa server on http://localhost:5005

What i´m doing bad? I have only edit credentials.yml and too i opened port 5005 in my EC2 Server

Please, some help. I´m learning slowy :slight_smile:

UPDATE 1: I have tried to use ngrok and open port 5005. I have taken the url.

webhook_url: “https://a8213ddd.ngrok.io/webhooks/telegram/webhook

and i have the same problem. stuck in Starting Server, i talk to the bot in telegram and dont work.

Hey @Nicanor,

Just for some clarification while I setup a demo env to help out where are you actually running the webhook part? On the ec2 instance?

If you can clarify this it will help me to tell ya how to fix this and get it working.

Hey @Nicanor,

I was able to get this all working fine for me locally using ngrok I basically followed the guide and just did the following:

  1. Updated the credentials.yml to look like this:
telegram:
  access_token: "xxx"
  verify: "brian_rasabot"
  webhook_url: "https://xxx.ngrok.io/webhooks/telegram/webhook"
  1. Then I just ran rasa run which starts up the server at localhost:5005
  2. So I then ran ngrok ./ngrok http 5005
  3. Go to telegram and talk to bot brian_rasabot and it works.

Screen Shot 2019-10-09 at 3.00.10 PM

1 Like

I dont know what happen.

telegram: access_token: “xxx” verify: “brian_rasabot” webhook_url: “https://xxx.ngrok.io/webhooks/telegram/webhook

1 ) the same 2) rasa run and stuck here! 38|690x400 3) ./ngrok dont work for me. i wrote ngrok http 5005. (when i put ./ say me there arent a directory)

So in that screenshot does anything ever show up in the logs after the last starting message? I’m assuming this bot works and you can hit it locally ok?

For ngrok you do the ./ngrok http 5005 from the dir where it is downloaded which is what gives you the HTTPS url that you use for your configuration section. Also keep in mind since you are using ngrok here the actual server is going to be hit at 443 so you will want to open that up in the firewall for the ec2 instance as well. Try that and let me know if you see any different results.

You could also just setup a ALB with SSL infront of this ec2 later if you wanted but the ngrok is a easy way to test it.

Yes, the bot run perfect.

I open port 443 in my console AWS and now i have a new error.

2019-10-09 14:04:32 INFO root - Starting Rasa server on http://localhost:5005 Unable to start server Traceback (most recent call last): File “/home/ubuntu/.local/lib/python3.6/site-packages/sanic/server.py”, line 745, in serve http_server = loop.run_until_complete(server_coroutine) File “uvloop/loop.pyx”, line 1417, in uvloop.loop.Loop.run_until_complete File “uvloop/loop.pyx”, line 1686, in create_server OSError: [Errno 98] error while attempting to bind on address (‘0.0.0.0’, 5005): address already in use

Double check if you have any other rasa instances somehow running you can check with ps -ef | grep rasa

:frowning:

The same problem, stuck in the capture i have send.

The Bot work perfects locally and the port 443 are open.

Sorry I don’t see a screen capture, what did the grep command show? Did you kill off the duplicate instance of Rasa that was running?

Yes i do. The command show the same as before.

Stuck in there

So can you hit your bot at the ngrok URL or what type of issue do you see there? If this is truly running like it should be that should mean the bot should be available at your https://ngrok_address so you should be able to hit it, if not it most likely is security related or ports.

Might want to try the process locally on your machine first to get familiar with it and verify it works then try again on the ec2 instance.

So far for me the entire process works fine using the guide locally I’m just gonna setup a ec2 instance real quick to show you that works as well and verify it.

And my credentials file …

if i hit https://5a045d28.ngrok.io/webhooks/telegram/webhook said me

Tunnel 5a045d28.ngrok.io not found

Looks like that ngrok url isn’t reachable, can you verify that is the right url? Where did you open up 443, everywhere or just your ip, etc.

could it be that a firewall is blocking ngrok?

well he said he opened up 443 on the ec2 security group so that should be enough

Guys, i have open two terminals and it work. Look.

Most likely you didn’t have Ngrok actually running then, you have to have each process run either in the foreground via 2 shells like you have or by sending the commands to the background. Glad you got it working!

Just verified as well @Nicanor I can talk to your bot on Telegram, looks like you are all set, let us know if you have further issues.

Yes it work. Thanks you!

Now i have to found the way to use it without Ngrok because have 8hour limit

Really thanks you,