Using API with deployed Rasa X

Hi!

I am trying to hit the API endpoint in order to have a conversation with my bot with a given message and conversation ID.

When I am running on my local machine, I can send a POST to http://localhost:5005/webhooks/rest/webhook .

The deployed version is at a different url such as https://rasa-x.com:8000. If I want to hit the API where this is deployed I am trying https://rasa-x.com:8000/webhooks/rest/webhook and sending the same payload:

{
    "sender":"test1",
    "message":"thanks"
}

I am getting a 404 error with this. I feel as if I am making a very small mistake here but I can’t seem to figure it out. Any idea why this isn’t working?

Thank you!

Hello!

What method did you use to deploy? Docker or Helm?

Have you tried sending the object to rasa-x.com/webhooks/rest/webhook (without the port)?

I used Helm. And yes I tried it with and without the port number. If I use the port number, I get a 404 saying not found, and for without the port number, it says that the request timed out.

Can you show me your values.yml?

Or, if you use Quick-Install, try to do in the shell:

export ADDITIONAL_CHANNEL_CREDENTIALS="rest=''"
curl -s get-rasa-x.rasa.com | sudo -E bash

Sure no problem. And thanks again for the help!

rasax:
  initialUser:
    username: "abhi"
    password: "#{RasaXPassword}"
  passwordSalt: "#{RasaXPasswordSalt}"
  token: "#{RasaXToken}"
  jwtSecret: "#{RasaXJwtSecret}"
  livenessProbe:
    initialProbeDelay: 30
  readinessProbe:
    initialProbeDelay: 30
eventService:
  databaseName: "#{Postgres:Database}"
rasa:
  token: "#{RasaToken}"
  versions:
    rasaProduction:
      trackerDatabase: "#{Postgres:RasaProduction}"
    rasaWorker:
      trackerDatabase: "#{Postgres:RasaWorker}"
rabbitmq:
  rabbitmq:
    password: "#{RabbitMqPassword}"
postgresql:
  install: false
  existingHost: "#{Postgres:Host}"
  existingSecretKey: "postgresql-password"
global:
  redis:
    password: "#{RedisPassword}"
  postgresql:
    postgresqlUsername: "#{Postgres:Username}"
    existingSecret: "external-postgres"
    postgresqlDatabase: "#{Postgres:Database}"
debugMode: "#{RasaDebugMode}"
1 Like

Try to set the following (last 2 lines) and upgrade the deployment with the modified values:

rasa:
  token: "#{RasaToken}"
  versions:
    rasaProduction:
      trackerDatabase: "#{Postgres:RasaProduction}"
    rasaWorker:
      trackerDatabase: "#{Postgres:RasaWorker}"
  additionalChannelCredentials:
      rest:

Ok great. I will try that and let you know!

1 Like

That fixed the issue I was having! Thank you for your help!

I do have one other question! I am currently using a custom entity extraction component where the component is in the same working directory as the config file and called communication_preference.py.

However, when the project is being deployed, the logs show an exception where the module cannot be found.

This is the error that is logged:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/registry.py", line 121, in get_component_class
    return rasa.shared.utils.common.class_from_module_path(component_name)
  File "/opt/venv/lib/python3.8/site-packages/rasa/shared/utils/common.py", line 37, in class_from_module_path
    m = importlib.import_module(module_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'communication_preference'

When I train on my local machine, the module is found and everything works great, but when deployed using Helm, this issue pops up. I’m assuming the module isn’t being added to the PATH but I am not sure how to go about doing this.

Thank you!

1 Like

Glad to know I helped :slight_smile: Can you mark my answer as solution to show the topic as solved?

As for your other problem, sorry I’m not sure how to solve it, I would need more details. Please create a new thread for that since it’s unrelated, more people would read the topic if it is new, and it will appear in search results if anyone has the same problem in the future.

1 Like

So it turns out, this didn’t completely solve the issue I was having. As I continue testing it, I found that I am not able to hit other Rest endpoints like I was locally. For example, I am attempting to use a GET request to get the conversations tracker. I do a request to

rasa-x.com:8000/conversations/TrackerTest/tracker

But when I do, I get back an html response and a 200 code. This is weird b/c it should be a json with a tracker object. Are there any other changes i need to make to the values.yml that I haven’t alread?

Thanks!

Actually, I remember having problems with that endpoint as well, even in Local Mode. I figured I wasn’t using it correctly and never thought about it again since I didn’t need it.

Did this endpoint work locally for you?

Gotcha. Yes, I’ve used that end point locally quite a bit to get the tracker object. I send a GET request at:

http://localhost:5005/conversations/testid/tracker

It’s always worked when I did that, so that is odd.

1 Like