RASA Chat Bot - Deployment and Integration Issues

Dear Team,

I was unable to deploy/Integrate my chat bot due to below issue/Error.

ValueError: check_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED

I have my custom bot designed in HTML, CSS, JQuery, AJAX and JSON.

Initially bot starts the communication before the client starts by using the below JS.

const action_name = "action_hello_world";
const rasa_server_url = "http://localhost:5005/webhooks/rest/webhook";
const sender_id = uuidv4();

Yes, this is working as expected.

But, In my bot there was a module which connects to our Solr Search Data Lake, and from where it gets the response for the user utterances.

Unfortunately, this is not happening due to the above mentioned error.

Is there a way to fix this?

Regarding Integration:

We have an application, where we want our bot to be appeared. I have developed the bot in my code as an index.html, and i want to place this bot on our website. How should i do that?

Your kind and prompt response will saves me :slight_smile: Thanks

Best Regards, Ravi

I don’t think I can’t help you regarding the main subject since it is not really related to Rasa. But can you tell which part of the code is throwing the error?

I recognize this is Jitesh’s Chatbot Widget, which works fine usually. Did you add or remove anything to the code?


As for this, just copy the code on any webpage you want it to appear in. Of course, if you don’t want to copy it on every page of your website, you can put it in a separate file and use something like PHP or Vue to include it.

Hi @ChrisRahme

Thank you for your response.

Yes i am using jitesh widget.

I have written some business logics in python. While executing that logics, there is another site to be hit and get the response back. Unfortunately that site accessed through https requests. This is where the issue occurs. And unable to perform ssl verification. Thanks

Best Regards Ravi

I think Stack Overflow would be a better place to ask this question.

Provide them the part of the code that generates the error as well.

Also if you post there, please add a reply with the link to your post if anyone comes across the same problem here :slight_smile:

Hi @ChrisRahme I have been fixed it by creating a wrpper to work as a proxy between http and https. Its fixed.

But, i am facing another issue with the webhook. Could you please suggest any idea? Thanks a ton in advance

here is my constant.js file code, just to perform initPayload using AJAX.

const action_name = "action_hello_world";
const rasa_server_url = "http://localhost:5005/webhooks/rest/webhook";
const sender_id = uuidv4();

endpoints.yml code

action_endpoint:
  url: "http://localhost:5055/webhook"

and in credentials.yml just enabled the rest channel

rest:

But, these url’s can’t be accessible.

Best Regards, Ravi

Are the widget and the bot on the same computer?

Hi @ChrisRahme Yes, they are on the same machine.

Can you send a message via Postman and get a reply?

POST: http://localhost:5005/webhooks/rest/webhook
Body: {"sender": "Postman", "message": "hello, world" }

Hi @ChrisRahme let me try. Thanks

Best Regards, Ravi

1 Like

Hi @ChrisRahme I have tested it on postman, and i am getting the response as expected.

[
    {
        "recipient_id": "Postman",
        "text": "Hello <b>Satish!</b> Thanks for choosing to chat with me."
    },
    {
        "recipient_id": "Postman",
        "text": "Please choose what you are looking for from the list below.",
        "buttons": [
            {
                "title": "Looking for documents in delta",
                "payload": "/lookingfordocumentsindelta"
            },
            {
                "title": "“How to” questions related to Delta",
                "payload": "/faq"
            },
            {
                "title": "Have Feedbacks",
                "payload": "/feedbacks"
            }
        ]
    }
]

Bot should be able to respond first…but unfortunately it’s not happening and it is working when user greets first like below.

The below is the expected response from bot.

Even tried by changing the IP and Host while initiating the AJAX call to the actions from chats.js like below. Still No Luck :sob:

function customActionTrigger() {

    $.ajax({

        url: "http://<hostname>:5055/webhook/",

        type: "POST",

        contentType: "application/json",

        data: JSON.stringify({

            next_action: action_name,

            tracker: {

                sender_id,

            },

        }),

        success(botResponse, status) {

            console.log("Response from Rasa: ", botResponse, "\nStatus: ", status);

            if (Object.hasOwnProperty.call(botResponse, "responses")) {

                setBotResponse(botResponse.responses);

            }

            $("#userInput").prop("disabled", false);

        },

        error(xhr, textStatus) {

            // if there is no response from rasa server

            setBotResponse("");

            console.log("Error from bot end: ", textStatus);

            $("#userInput").prop("disabled", false);

        },

    });

}

constants.js code is as below :

const action_name = "action_hello_world";
const rasa_server_url = "http://<hostname>:5005/webhooks/rest/webhook";
const sender_id = uuidv4();

I leave it as it is from endpoints.yml

action_endpoint:
  url: "http://localhost:5055/webhook"

Best Regards, Ravi

Hi @ChrisRahme Haha, Please don’t laugh at me…

I think i have fixed the issue. It’s pretty silly and bit crazy too.

The issue i have observed is, there was a main jquery.min.js file, which was kept in the body at last. Unfortunately this has to be the first script tag. I have tested it on my local and it’s working as expected.

Yet to test it on UAT. Will keep you posted. Thanks for your help

Best Regards, Ravi

Ah so want the bot to speak first, right?

Did you solve it by now?

And no worries, I won’t laugh at anyone :slight_smile: Maybe I wouldn’t have though about it!

1 Like

Hi @ChrisRahme Good Morning :slight_smile:

Yes it’s working now on my UAT. Thanks

Best Regards, Ravi