botfront / rasa-webchat

A feature-rich chat widget for Rasa and Botfront
https://botfront.io/rasa
Apache License 2.0
945 stars 495 forks source link

Getting 'AsyncServer.enter_room' was never awaited error. #476

Closed armitamani closed 8 months ago

armitamani commented 9 months ago

Hello, I am using webchat for RASA model. Model is working properly in command prompt. But whenever i am trying to run in web i yterface, i am getting error: "lib\site-packages\rasa\core\channels\socketio.py:222: RuntimeWarning: coroutine 'AsyncServer.enter_room' was never awaited sio.enter_room(sid, data["session_id"]) RuntimeWarning: Enable tracemalloc to get the object allocation traceback " Can anyone help?

Rasa Version: 2.8.0 Python: 3.8.1

Code which I have written in my index.html page for web integration:


` <body>
        <script>!(function () {
        let e = document.createElement("script"),
          t = document.head || document.getElementsByTagName("head")[0];
        (e.src =
          "https://cdn.jsdelivr.net/npm/rasa-webchat@1.x.x/lib/index.js"),
          // Replace 1.x.x with the version that you want
          (e.async = !0),
          (e.onload = () => {
            window.WebChat.default(
              {

            customData: { language: "en" },
                socketUrl: "http://localhost:5005",
            title:"Counselling-Bot",
            subtitle:"code-mixed"

                // add other props here
              },
              null
            );
          }),
          t.insertBefore(e, t.firstChild);
      })();
      </script>

      `
nocontrolla commented 8 months ago

Is RASA CORS running, because the web integration webchat looks for the SocketURL localhost:5005?

armitamani commented 8 months ago

Is RASA CORS running, because the web integration webchat looks for the SocketURL localhost:5005?

Yes, its running and now web interface is also working.

I made one change in credentials.yml file. In the socketio option, I changed session_persistence from false to true.

and it worked for me.

But still I have one confusion, previous code (without any change in credentials file) is running on one system but not on other. Strange behaviour!!