Webchat - Docker - GCP - Failed to load resource

I have installed rasa x on a google compute engine:

  • Rasa x version 0.33.0
  • Rasa version 2.0.2

I am using docker, and I can talk to my chatbot via the conversations tab in rasa x.

Now I want to use rasa webchat as frontend. I got this to work locally, but on the server I keep getting the error “Failed to load resource: the server responded with a status of 404 (Not Found), :5005/socket.io/?EIO=3&transport=polling&t=NUBsNmS:1” when I try to access the website for the frontend.

My credentials file looks like this:

rasa:
  url: ${RASA_X_HOST}/api

connectors.socketChannel.SocketIOInput:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

I have also copied the socketChannel.py into /etc/rasa/connectors:

import logging
import uuid
from typing import Any, Awaitable, Callable, Dict, Iterable, List, Optional, Text

from rasa.core.channels.channel import InputChannel, OutputChannel, UserMessage
import rasa.shared.utils.io
from sanic import Blueprint, response
from sanic.request import Request
from sanic.response import HTTPResponse
from socketio import AsyncServer

logger = logging.getLogger(__name__)


class SocketBlueprint(Blueprint):
    def __init__(self, sio: AsyncServer, socketio_path, *args, **kwargs):
        self.sio = sio
        self.socketio_path = socketio_path
        super().__init__(*args, **kwargs)

    def register(self, app, options) -> None:
        self.sio.attach(app, self.socketio_path)
        super().register(app, options)


class SocketIOOutput(OutputChannel):
    @classmethod
    def name(cls) -> Text:
        return "socketio"

    def __init__(self, sio: AsyncServer, bot_message_evt: Text) -> None:
        self.sio = sio
        self.bot_message_evt = bot_message_evt

    async def _send_message(self, socket_id: Text, response: Any) -> None:
        """Sends a message to the recipient using the bot event."""

        await self.sio.emit(self.bot_message_evt, response, room=socket_id)

    async def send_text_message(
        self, recipient_id: Text, text: Text, **kwargs: Any
    ) -> None:
        """Send a message through this channel."""

        for message_part in text.strip().split("\n\n"):
            await self._send_message(recipient_id, {"text": message_part})

    async def send_image_url(
        self, recipient_id: Text, image: Text, **kwargs: Any
    ) -> None:
        """Sends an image to the output"""

        message = {"attachment": {"type": "image", "payload": {"src": image}}}
        await self._send_message(recipient_id, message)

    async def send_text_with_buttons(
        self,
        recipient_id: Text,
        text: Text,
        buttons: List[Dict[Text, Any]],
        **kwargs: Any,
    ) -> None:
        """Sends buttons to the output."""

        # split text and create a message for each text fragment
        # the `or` makes sure there is at least one message we can attach the quick
        # replies to
        message_parts = text.strip().split("\n\n") or [text]
        messages = [{"text": message, "quick_replies": []} for message in message_parts]

        # attach all buttons to the last text fragment
        for button in buttons:
            messages[-1]["quick_replies"].append(
                {
                    "content_type": "text",
                    "title": button["title"],
                    "payload": button["payload"],
                }
            )

        for message in messages:
            await self._send_message(recipient_id, message)

    async def send_elements(
        self, recipient_id: Text, elements: Iterable[Dict[Text, Any]], **kwargs: Any
    ) -> None:
        """Sends elements to the output."""

        for element in elements:
            message = {
                "attachment": {
                    "type": "template",
                    "payload": {"template_type": "generic", "elements": element},
                }
            }

            await self._send_message(recipient_id, message)

    async def send_custom_json(
        self, recipient_id: Text, json_message: Dict[Text, Any], **kwargs: Any
    ) -> None:
        """Sends custom json to the output"""

        json_message.setdefault("room", recipient_id)

        await self.sio.emit(self.bot_message_evt, **json_message)

    async def send_attachment(
        self, recipient_id: Text, attachment: Dict[Text, Any], **kwargs: Any
    ) -> None:
        """Sends an attachment to the user."""
        await self._send_message(recipient_id, {"attachment": attachment})


class SocketIOInput(InputChannel):
    """A socket.io input channel."""

    @classmethod
    def name(cls) -> Text:
        return "socketio"

    @classmethod
    def from_credentials(cls, credentials: Optional[Dict[Text, Any]]) -> InputChannel:
        credentials = credentials or {}
        return cls(
            credentials.get("user_message_evt", "user_uttered"),
            credentials.get("bot_message_evt", "bot_uttered"),
            credentials.get("namespace"),
            credentials.get("session_persistence", False),
            credentials.get("socketio_path", "/socket.io"),
        )

    def __init__(
        self,
        user_message_evt: Text = "user_uttered",
        bot_message_evt: Text = "bot_uttered",
        namespace: Optional[Text] = None,
        session_persistence: bool = False,
        socketio_path: Optional[Text] = "/socket.io",
    ):
        self.bot_message_evt = bot_message_evt
        self.session_persistence = session_persistence
        self.user_message_evt = user_message_evt
        self.namespace = namespace
        self.socketio_path = socketio_path
        self.sio = None

    def get_output_channel(self) -> Optional["OutputChannel"]:
        if self.sio is None:
            rasa.shared.utils.io.raise_warning(
                "SocketIO output channel cannot be recreated. "
                "This is expected behavior when using multiple Sanic "
                "workers or multiple Rasa Open Source instances. "
                "Please use a different channel for external events in these "
                "scenarios."
            )
            return
        return SocketIOOutput(self.sio, self.bot_message_evt)

    def blueprint(
        self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
    ) -> Blueprint:
        # Workaround so that socketio works with requests from other origins.
        # https://github.com/miguelgrinberg/python-socketio/issues/205#issuecomment-493769183
        sio = AsyncServer(async_mode="sanic", cors_allowed_origins = [])
        socketio_webhook = SocketBlueprint(
            sio, self.socketio_path, "socketio_webhook", __name__
        )

        # make sio object static to use in get_output_channel
        self.sio = sio

        @socketio_webhook.route("/", methods=["GET"])
        async def health(_: Request) -> HTTPResponse:
            return response.json({"status": "ok"})

        @sio.on("connect", namespace=self.namespace)
        async def connect(sid: Text, _) -> None:
            logger.debug(f"User {sid} connected to socketIO endpoint.")

        @sio.on("disconnect", namespace=self.namespace)
        async def disconnect(sid: Text) -> None:
            logger.debug(f"User {sid} disconnected from socketIO endpoint.")

        @sio.on("session_request", namespace=self.namespace)
        async def session_request(sid: Text, data: Optional[Dict]):
            if data is None:
                data = {}
            if "session_id" not in data or data["session_id"] is None:
                data["session_id"] = uuid.uuid4().hex
            if self.session_persistence:
                sio.enter_room(sid, data["session_id"])
            await sio.emit("session_confirm", data["session_id"], room=sid)
            logger.debug(f"User {sid} connected to socketIO endpoint.")

        @sio.on(self.user_message_evt, namespace=self.namespace)
        async def handle_message(sid: Text, data: Dict) -> Any:
            output_channel = SocketIOOutput(sio, self.bot_message_evt)

            if self.session_persistence:
                if not data.get("session_id"):
                    rasa.shared.utils.io.raise_warning(
                        "A message without a valid session_id "
                        "was received. This message will be "
                        "ignored. Make sure to set a proper "
                        "session id using the "
                        "`session_request` socketIO event."
                    )
                    return
                sender_id = data["session_id"]
            else:
                sender_id = sid

            message = UserMessage(
                data["message"], output_channel, sender_id, input_channel=self.name()
            )
            await on_new_message(message)

        return socketio_webhook

And this is my docker-compose.override file:

version: '3.4'

x-rasa-services:
  command:
    --enable-api

services:
  app:
    image: myimage
    volumes:
      - ./actions:/app/actions
      - ./db_scripts:/app/db_scripts
    expose:
      - '5055'
    depends_on:
      - rasa-production
  
  rasa-production:
    volumes:
      - ./connectors:/app/connectors
  rasa-worker:
    volumes:
      - ./connectors:/app/connectors  

And this is the webchat part in my index.html file for the frontend:

<div id="webchat"></div>
<script src="https://cdn.jsdelivr.net/npm/rasa-webchat@0.11.5/lib/index.min.js"></script>
<script>
      const queryString = window.location.search;
      const urlParams = new URLSearchParams(queryString);
      const userid = urlParams.get('userid');
      // const userid = "111"
	  WebChat.default.init({
		selector: "#webchat",
		initPayload: "/start_session1",
		customData: {"language":"en", "userid": userid}, // arbitrary custom data. Stay minimal as this will be added to the socket
		socketUrl: "http://myserver:5005",
		socketPath: "/socket.io/",
		fullScreenMode: true,
		embedded: true,
		title: "Sam",
		subtitle: "",
		params: {"storage": "session"} // can be set to "local"  or "session". details in storage section.
})
</script>

I’ve been trying to get this to work for days now and I would greatly appreciate any help. Thanks a lot in advance!

This looks like you might be providing the wrong address. You want http://<host>:<port>/socketio , so:

		socketUrl: "http://myserver:5005",
		socketPath: "/socketio/",

That’s based on the Rasa docs, but I see that Webchat provides it as socket.io. Worth trying.

You should also see in your rasa run --debug startup logs a list of available routes. Is socketio or socket.io there?

Hi,

Thanks so much for trying to help me!

I have tried out your suggestion, i.e. to use “/socketio/” instead of “/socket.io/” and now I get the following error:

image

The picture of my old error is as follows:

old_error

They seem to be quite similar I think, but I know very little about this.

In my rasa docker container, I am also getting the following error in the logs:

 pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=21, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.112.8', 50850)>; error=111 (Connection refused)
2021-02-11 20:58:13 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('192.168.112.2', 5672))

Does this explain my problem in any way by any chance?

I’m entirely new to this so I’d very much appreciate any further guidance!

Hmm I’m not sure - Can you post the logs from your rasa server itself? Everything from when it starts up to when it says Rasa server is running.

Could you please tell me how to get those? All I have done so far is type "docker logs " for my different containers. My apologies for these absolutely naive questions.

No worries! To get logs for a specific service in a docker-compose set up, just add the service name. E.g.:

sudo docker-compose logs rasa-production

rasa-production and rasa-worker are both “rasa servers”, but production is the one that the socketio webhook will be talking to.

Great, thanks! This is what I get then:

ca-test-server@ca-test-server2:/etc/rasa$ sudo docker-compose logs rasa-production
Attaching to rasa_rasa-production_1
rasa-production_1  | 2021-02-12 10:05:44 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=22, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.224.9', 35980)>; error=111 (Connection refused)
rasa-production_1  | 2021-02-12 10:05:44 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('192.168.224.5', 5672))
rasa-production_1  | 2021-02-12 10:05:44 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:05:49 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=25, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.224.9', 36006)>; error=111 (Connection refused)
rasa-production_1  | 2021-02-12 10:05:49 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('192.168.224.5', 5672))
rasa-production_1  | 2021-02-12 10:05:49 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:05:54 ERROR    pika.connection  - Connection closed while authenticating indicating a probable authentication error
rasa-production_1  | 2021-02-12 10:05:54 WARNING  rasa.core.brokers.pika  - Connecting to 'rabbit' failed with error 'ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.''. Trying again.
rasa-production_1  | 2021-02-12 10:05:54 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",)
rasa-production_1  | 2021-02-12 10:05:54 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 3 exceptions in all; last exception - AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",); first exception - AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:05:54 ERROR    pika.adapters.base_connection  - Full-stack connection workflow failed: AMQPConnectionWorkflowFailed: 3 exceptions in all; last exception - AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",); first exception - AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:05:54 ERROR    pika.adapters.base_connection  - Self-initiated stack bring-up failed: AMQPConnectionWorkflowFailed: 3 exceptions in all; last exception - AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",); first exception - AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')

I think you definitely have a rabbit problem (will get to that next), but you can’t see more logs because it’s not running in debug mode. Can you turn debug mode on and check the logs again? Debug mode is available as an environmental variable, you set it in your .env file Customize Your Deployment

Can you see logs in the rabbit container?

Thanks for getting back to me!

I turned on the debug mode in the .env file:

DEBUG_MODE=true

But the logs for rasa production are the same as before I think:

rasa-production_1  | 2021-02-12 10:49:49 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=21, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.240.8', 53868)>; error=111 (Connection refused)
rasa-production_1  | 2021-02-12 10:49:49 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('192.168.240.4', 5672))
rasa-production_1  | 2021-02-12 10:49:50 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:49:55 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=25, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.240.8', 53884)>; error=111 (Connection refused)
rasa-production_1  | 2021-02-12 10:49:55 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('192.168.240.4', 5672))
rasa-production_1  | 2021-02-12 10:49:55 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:50:00 ERROR    pika.connection  - Connection closed while authenticating indicating a probable authentication error
rasa-production_1  | 2021-02-12 10:50:00 WARNING  rasa.core.brokers.pika  - Connecting to 'rabbit' failed with error 'ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.''. Trying again.
rasa-production_1  | 2021-02-12 10:50:00 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",)
rasa-production_1  | 2021-02-12 10:50:00 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnectionWorkflow - reporting failure: AMQPConnectionWorkflowFailed: 3 exceptions in all; last exception - AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",); first exception - AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:50:00 ERROR    pika.adapters.base_connection  - Full-stack connection workflow failed: AMQPConnectionWorkflowFailed: 3 exceptions in all; last exception - AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",); first exception - AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2021-02-12 10:50:00 ERROR    pika.adapters.base_connection  - Self-initiated stack bring-up failed: AMQPConnectionWorkflowFailed: 3 exceptions in all; last exception - AMQPConnectorAMQPHandshakeError: ProbableAuthenticationError: Client was disconnected at a connection stage indicating a probable authentication error: ("ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'",); first exception - AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')

Am I missing something to create more detailed logs?

I also had a look at the logs for the rabbit container. There don’t seem to be any errors there:

rabbit_1           | rabbitmq 10:49:23.98 Welcome to the Bitnami rabbitmq container
rabbit_1           | rabbitmq 10:49:23.98 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-rabbitmq
rabbit_1           | rabbitmq 10:49:23.98 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-rabbitmq/issues
rabbit_1           | rabbitmq 10:49:23.98
rabbit_1           | rabbitmq 10:49:23.99 INFO  ==> ** Starting RabbitMQ setup **
rabbit_1           | rabbitmq 10:49:24.03 INFO  ==> Validating settings in RABBITMQ_* env vars..
rabbit_1           | rabbitmq 10:49:24.05 INFO  ==> Initializing RabbitMQ...
rabbit_1           | rabbitmq 10:49:24.08 INFO  ==> Generating random cookie
rabbit_1           | rabbitmq 10:49:24.11 INFO  ==> Starting RabbitMQ in background...
rabbit_1           | rabbitmq 10:50:05.22 INFO  ==> Stopping RabbitMQ...
rabbit_1           | rabbitmq 10:50:12.62 INFO  ==> ** RabbitMQ setup finished! **
rabbit_1           |
rabbit_1           | rabbitmq 10:50:12.72 INFO  ==> ** Starting RabbitMQ **
rabbit_1           | Configuring logger redirection
rabbit_1           | 2021-02-12 10:50:36.913 [debug] <0.284.0> Lager installed handler error_logger_lager_h into error_logger
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.287.0> Lager installed handler lager_forwarder_backend into error_logger_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.290.0> Lager installed handler lager_forwarder_backend into rabbit_log_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.293.0> Lager installed handler lager_forwarder_backend into rabbit_log_channel_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.296.0> Lager installed handler lager_forwarder_backend into rabbit_log_connection_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.299.0> Lager installed handler lager_forwarder_backend into rabbit_log_feature_flags_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.302.0> Lager installed handler lager_forwarder_backend into rabbit_log_federation_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.320.0> Lager installed handler lager_forwarder_backend into rabbit_log_shovel_lager_event
rabbit_1           | 2021-02-12 10:50:36.937 [debug] <0.323.0> Lager installed handler lager_forwarder_backend into rabbit_log_upgrade_lager_event
rabbit_1           | 2021-02-12 10:50:36.939 [debug] <0.305.0> Lager installed handler lager_forwarder_backend into rabbit_log_ldap_lager_event
rabbit_1           | 2021-02-12 10:50:36.939 [debug] <0.308.0> Lager installed handler lager_forwarder_backend into rabbit_log_mirroring_lager_event
rabbit_1           | 2021-02-12 10:50:36.940 [debug] <0.311.0> Lager installed handler lager_forwarder_backend into rabbit_log_prelaunch_lager_event
rabbit_1           | 2021-02-12 10:50:36.940 [debug] <0.314.0> Lager installed handler lager_forwarder_backend into rabbit_log_queue_lager_event
rabbit_1           | 2021-02-12 10:50:36.940 [debug] <0.317.0> Lager installed handler lager_forwarder_backend into rabbit_log_ra_lager_event
rabbit_1           | 2021-02-12 10:50:36.958 [info] <0.44.0> Application lager started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:37.414 [debug] <0.280.0> Lager installed handler lager_backend_throttle into lager_event
rabbit_1           | 2021-02-12 10:50:39.845 [info] <0.44.0> Application mnesia started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:39.848 [info] <0.269.0>
rabbit_1           |  Starting RabbitMQ 3.8.9 on Erlang 22.3
rabbit_1           |  Copyright (c) 2007-2020 VMware, Inc. or its affiliates.
rabbit_1           |  Licensed under the MPL 2.0. Website: https://rabbitmq.com
rabbit_1           |
rabbit_1           |   ##  ##      RabbitMQ 3.8.9
rabbit_1           |   ##  ##
rabbit_1           |   ##########  Copyright (c) 2007-2020 VMware, Inc. or its affiliates.
rabbit_1           |   ######  ##
rabbit_1           |   ##########  Licensed under the MPL 2.0. Website: https://rabbitmq.com
rabbit_1           |
rabbit_1           |   Doc guides: https://rabbitmq.com/documentation.html
rabbit_1           |   Support:    https://rabbitmq.com/contact.html
rabbit_1           |   Tutorials:  https://rabbitmq.com/getstarted.html
rabbit_1           |   Monitoring: https://rabbitmq.com/monitoring.html
rabbit_1           |
rabbit_1           |   Logs: <stdout>
rabbit_1           |
rabbit_1           |   Config file(s): /opt/bitnami/rabbitmq/etc/rabbitmq/rabbitmq.conf
rabbit_1           |
rabbit_1           |   Starting broker...2021-02-12 10:50:39.853 [info] <0.269.0>
rabbit_1           |  node           : rabbit@localhost
rabbit_1           |  home dir       : /opt/bitnami/rabbitmq/.rabbitmq
rabbit_1           |  config file(s) : /opt/bitnami/rabbitmq/etc/rabbitmq/rabbitmq.conf
rabbit_1           |  cookie hash    : fKhIzLppPY1PEUt+x5JbgA==
rabbit_1           |  log(s)         : <stdout>
rabbit_1           |  database dir   : /bitnami/rabbitmq/mnesia/rabbit@localhost
rabbit_1           | 2021-02-12 10:50:39.874 [info] <0.269.0> Running boot step pre_boot defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.874 [info] <0.269.0> Running boot step rabbit_core_metrics defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.876 [info] <0.269.0> Running boot step rabbit_alarm defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.892 [info] <0.406.0> Memory high watermark set to 3184 MiB (3339275468 bytes) of 7961 MiB (8348188672 bytes) total
rabbit_1           | 2021-02-12 10:50:39.905 [info] <0.438.0> Enabling free disk space monitoring
rabbit_1           | 2021-02-12 10:50:39.906 [info] <0.438.0> Disk free limit set to 8348MB
rabbit_1           | 2021-02-12 10:50:39.910 [info] <0.269.0> Running boot step code_server_cache defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.910 [info] <0.269.0> Running boot step file_handle_cache defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.911 [info] <0.450.0> Limiting to approx 1048479 file handles (943629 sockets)
rabbit_1           | 2021-02-12 10:50:39.911 [info] <0.451.0> FHC read buffering:  OFF
rabbit_1           | 2021-02-12 10:50:39.911 [info] <0.451.0> FHC write buffering: ON
rabbit_1           | 2021-02-12 10:50:39.912 [info] <0.269.0> Running boot step worker_pool defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.912 [info] <0.383.0> Will use 2 processes for default worker pool
rabbit_1           | 2021-02-12 10:50:39.912 [info] <0.383.0> Starting worker pool 'worker_pool' with 2 processes in it
rabbit_1           | 2021-02-12 10:50:39.912 [info] <0.269.0> Running boot step database defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.915 [info] <0.269.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
rabbit_1           | 2021-02-12 10:50:39.919 [info] <0.269.0> Successfully synced tables from a peer
rabbit_1           | 2021-02-12 10:50:39.919 [info] <0.269.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
rabbit_1           | 2021-02-12 10:50:39.919 [info] <0.269.0> Successfully synced tables from a peer
rabbit_1           | 2021-02-12 10:50:39.945 [info] <0.269.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
rabbit_1           | 2021-02-12 10:50:39.945 [info] <0.269.0> Successfully synced tables from a peer
rabbit_1           | 2021-02-12 10:50:39.945 [info] <0.269.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration.
rabbit_1           | 2021-02-12 10:50:39.946 [info] <0.269.0> Running boot step database_sync defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.946 [info] <0.269.0> Running boot step feature_flags defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.947 [info] <0.269.0> Running boot step codec_correctness_check defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.947 [info] <0.269.0> Running boot step external_infrastructure defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.947 [info] <0.269.0> Running boot step rabbit_registry defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.947 [info] <0.269.0> Running boot step rabbit_auth_mechanism_cr_demo defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.948 [info] <0.269.0> Running boot step rabbit_queue_location_random defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.948 [info] <0.269.0> Running boot step rabbit_event defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.948 [info] <0.269.0> Running boot step rabbit_auth_mechanism_amqplain defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.949 [info] <0.269.0> Running boot step rabbit_auth_mechanism_plain defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.949 [info] <0.269.0> Running boot step rabbit_exchange_type_direct defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.949 [info] <0.269.0> Running boot step rabbit_exchange_type_fanout defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.949 [info] <0.269.0> Running boot step rabbit_exchange_type_headers defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.949 [info] <0.269.0> Running boot step rabbit_exchange_type_topic defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_mirror_queue_mode_all defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_mirror_queue_mode_exactly defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_mirror_queue_mode_nodes defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_priority_queue defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Priority queues enabled, real BQ is rabbit_variable_queue
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_queue_location_client_local defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_queue_location_min_masters defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step kernel_ready defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.950 [info] <0.269.0> Running boot step rabbit_sysmon_minder defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.951 [info] <0.269.0> Running boot step rabbit_epmd_monitor defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.952 [info] <0.471.0> epmd monitor knows us, inter-node communication (distribution) port: 25672
rabbit_1           | 2021-02-12 10:50:39.953 [info] <0.269.0> Running boot step guid_generator defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.957 [info] <0.269.0> Running boot step rabbit_node_monitor defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.958 [info] <0.475.0> Starting rabbit_node_monitor
rabbit_1           | 2021-02-12 10:50:39.958 [info] <0.269.0> Running boot step delegate_sup defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.960 [info] <0.269.0> Running boot step rabbit_memory_monitor defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.961 [info] <0.269.0> Running boot step core_initialized defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.961 [info] <0.269.0> Running boot step upgrade_queues defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.982 [info] <0.269.0> Running boot step rabbit_connection_tracking defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.983 [info] <0.269.0> Running boot step rabbit_connection_tracking_handler defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.983 [info] <0.269.0> Running boot step rabbit_exchange_parameters defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.983 [info] <0.269.0> Running boot step rabbit_mirror_queue_misc defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.984 [info] <0.269.0> Running boot step rabbit_policies defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.985 [info] <0.269.0> Running boot step rabbit_policy defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.985 [info] <0.269.0> Running boot step rabbit_queue_location_validator defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.985 [info] <0.269.0> Running boot step rabbit_quorum_memory_manager defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.985 [info] <0.269.0> Running boot step rabbit_vhost_limit defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.986 [info] <0.269.0> Running boot step recovery defined by app rabbit
rabbit_1           | 2021-02-12 10:50:39.988 [info] <0.504.0> Making sure data directory '/bitnami/rabbitmq/mnesia/rabbit@localhost/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists
rabbit_1           | 2021-02-12 10:50:39.993 [info] <0.504.0> Starting message stores for vhost '/'
rabbit_1           | 2021-02-12 10:50:39.994 [info] <0.508.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index
rabbit_1           | 2021-02-12 10:50:39.997 [info] <0.504.0> Started message store of type transient for vhost '/'
rabbit_1           | 2021-02-12 10:50:39.997 [info] <0.512.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index
rabbit_1           | 2021-02-12 10:50:40.000 [info] <0.504.0> Started message store of type persistent for vhost '/'
rabbit_1           | 2021-02-12 10:50:40.008 [info] <0.269.0> Running boot step empty_db_check defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.008 [info] <0.269.0> Will not seed default virtual host and user: have definitions to load...
rabbit_1           | 2021-02-12 10:50:40.008 [info] <0.269.0> Running boot step rabbit_looking_glass defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.008 [info] <0.269.0> Running boot step rabbit_core_metrics_gc defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.009 [info] <0.269.0> Running boot step background_gc defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.009 [info] <0.269.0> Running boot step connection_tracking defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.009 [info] <0.269.0> Setting up a table for connection tracking on this node: tracked_connection_on_node_rabbit@localhost
rabbit_1           | 2021-02-12 10:50:40.010 [info] <0.269.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost_on_node_rabbit@localhost
rabbit_1           | 2021-02-12 10:50:40.010 [info] <0.269.0> Running boot step routing_ready defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.010 [info] <0.269.0> Running boot step pre_flight defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.010 [info] <0.269.0> Running boot step notify_cluster defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.011 [info] <0.269.0> Running boot step networking defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.011 [info] <0.269.0> Running boot step definition_import_worker_pool defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.011 [info] <0.383.0> Starting worker pool 'definition_import_pool' with 2 processes in it
rabbit_1           | 2021-02-12 10:50:40.012 [info] <0.269.0> Running boot step cluster_name defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.012 [info] <0.269.0> Running boot step direct_client defined by app rabbit
rabbit_1           | 2021-02-12 10:50:40.012 [info] <0.44.0> Application rabbit started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:40.773 [info] <0.544.0> Feature flags: list of feature flags found:
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags:   [ ] drop_unroutable_metric
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags:   [ ] empty_basic_get_metric
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags:   [x] implicit_default_bindings
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags:   [x] maintenance_mode_status
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags:   [x] quorum_queue
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags:   [x] virtual_host_metadata
rabbit_1           | 2021-02-12 10:50:40.774 [info] <0.544.0> Feature flags: feature flag states written to disk: yes
rabbit_1           | 2021-02-12 10:50:41.009 [info] <0.544.0> Running boot step rabbit_mgmt_db_handler defined by app rabbitmq_management_agent
rabbit_1           | 2021-02-12 10:50:41.009 [info] <0.544.0> Management plugin: using rates mode 'basic'
rabbit_1           | 2021-02-12 10:50:41.015 [info] <0.44.0> Application rabbitmq_management_agent started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:41.034 [info] <0.44.0> Application cowlib started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:41.052 [info] <0.44.0> Application cowboy started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:41.071 [info] <0.44.0> Application rabbitmq_web_dispatch started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:41.089 [info] <0.44.0> Application amqp_client started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:41.107 [info] <0.544.0> Running boot step rabbit_mgmt_reset_handler defined by app rabbitmq_management
rabbit_1           | 2021-02-12 10:50:41.107 [info] <0.544.0> Running boot step rabbit_management_load_definitions defined by app rabbitmq_management
rabbit_1           | 2021-02-12 10:50:41.148 [info] <0.613.0> Management plugin: HTTP (non-TLS) listener started on port 15672
rabbit_1           | 2021-02-12 10:50:41.148 [info] <0.719.0> Statistics database started.
rabbit_1           | 2021-02-12 10:50:41.148 [info] <0.718.0> Starting worker pool 'management_worker_pool' with 3 processes in it
rabbit_1           | 2021-02-12 10:50:41.149 [info] <0.544.0> Ready to start client connection listeners
rabbit_1           | 2021-02-12 10:50:41.151 [info] <0.44.0> Application rabbitmq_management started on node rabbit@localhost
rabbit_1           | 2021-02-12 10:50:41.152 [info] <0.740.0> started TCP listener on [::]:5672
rabbit_1           | 2021-02-12 10:50:41.466 [info] <0.544.0> Server startup complete; 3 plugins started.
rabbit_1           |  * rabbitmq_management
rabbit_1           |  * rabbitmq_web_dispatch
rabbit_1           |  * rabbitmq_management_agent
rabbit_1           |  completed with 3 plugins.
rabbit_1           | 2021-02-12 10:50:41.466 [info] <0.544.0> Resetting node maintenance status
rabbit_1           | 2021-02-12 10:50:45.384 [info] <0.745.0> accepting AMQP connection <0.745.0> (192.168.240.7:58818 -> 192.168.240.4:5672)
rabbit_1           | 2021-02-12 10:50:45.389 [info] <0.745.0> connection <0.745.0> (192.168.240.7:58818 -> 192.168.240.4:5672): user 'user' authenticated and granted access to vhost '/'

To supplement my message above, I also found errors in the logs of one of the rasa x containers:

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Rasa Open Source reports anonymous usage telemetry to help improve the product x
x for all its users.                                                             x
x                                                                                x
x If you'd like to opt-out, you can use `rasa telemetry disable`.                x
x To learn more, check out https://rasa.com/docs/rasa/telemetry/telemetry.       x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Starting Rasa X server... 🚀
[2021-02-12 12:40:53 +0000] [8] [INFO] Goin' Fast @ http://0.0.0.0:5002
[2021-02-12 12:40:57 +0000] [27] [INFO] Starting worker [27]
[2021-02-12 12:40:57 +0000] [24] [INFO] Starting worker [24]
[2021-02-12 12:40:57 +0000] [29] [INFO] Starting worker [29]
[2021-02-12 12:40:57 +0000] [26] [INFO] Starting worker [26]
INFO:rasax.community.services.event_service:Starting event service (standalone: False).
[2021-02-12 12:41:00 +0000] - (sanic.access)[INFO][172.19.0.8:48396]: GET http://rasa-x:5002/api/config?token=Vk0jyu7A3EgIrMr  200 878
[2021-02-12 12:41:01 +0000] - (sanic.access)[INFO][172.19.0.9:33272]: GET http://rasa-x:5002/api/config?token=Vk0jyu7A3EgIrMr  200 878
[2021-02-12 12:41:02 +0000] - (sanic.access)[INFO][172.19.0.8:48416]: GET http://rasa-x:5002/api/projects/default/models/tags/production?token=Vk0jyu7A3EgIrMr  404 160
[2021-02-12 12:41:02 +0000] - (sanic.access)[INFO][172.19.0.9:33296]: GET http://rasa-x:5002/api/projects/default/models/tags/production?token=Vk0jyu7A3EgIrMr  404 160
[2021-02-12 12:41:16 +0000] - (sanic.access)[INFO][172.19.0.8:48444]: GET http://rasa-x:5002/api/projects/default/models/tags/production?token=Vk0jyu7A3EgIrMr  200 -1
[2021-02-12 12:41:16 +0000] - (sanic.access)[INFO][172.19.0.9:33322]: GET http://rasa-x:5002/api/projects/default/models/tags/production?token=Vk0jyu7A3EgIrMr  200 -1
ERROR:pika.adapters.blocking_connection:Unexpected connection close detected: ConnectionClosedByBroker: (320) "CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'"
ERROR:rasax.community.services.event_service:Caught an exception while consuming events. Will retry in 5 s.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/event_service.py", line 1713, in continuously_consume
    consumer.consume()
  File "/usr/local/lib/python3.7/site-packages/rasax/community/services/event_consumers/pika_consumer.py", line 177, in consume
    self.channel.start_consuming()
  File "/usr/local/lib/python3.7/site-packages/pika/adapters/blocking_connection.py", line 1866, in start_consuming
    self._process_data_events(time_limit=None)
  File "/usr/local/lib/python3.7/site-packages/pika/adapters/blocking_connection.py", line 2027, in _process_data_events
    self.connection.process_data_events(time_limit=time_limit)
  File "/usr/local/lib/python3.7/site-packages/pika/adapters/blocking_connection.py", line 825, in process_data_events
    self._flush_output(common_terminator)
  File "/usr/local/lib/python3.7/site-packages/pika/adapters/blocking_connection.py", line 522, in _flush_output
    raise self._closed_result.value.error
pika.exceptions.ConnectionClosedByBroker: (320, "CONNECTION_FORCED - broker forced connection closure with reason 'shutdown'")

In the meantime I have updated rasa x to 0.33.2, but that also did not help.

Please let me know of any further ideas you might have of how to fix this!

I was able to solve it. The problem was in the index.html file. I changed the socketUrl to “http://myserver”, i.e. I removed the port number from there. The pika errors still show up in the logs but that does not seem to cause any visible problems.

Glad you fixed it! I would look for errors in the rabbit container if you still see issues with Pika elsewhere.