Socket.io channel working with ngrok but not from GCP server

Hi,

Things are working well for website chat with the following local credentials:

...
socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

rasa:
  url: "http://localhost:5005/webhook"
...

But I am unable to make it from the server with GCP that has this in credentials.yml:

rasa$ cat credentials.yml 
rasa:
  url: ${RASA_X_HOST}/api

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

The SSL is setup for the server and it is pointing to rasax (which is working well). I am not sure if this is relevant, but these are the errors when we start the docker:

rasa-x_1           | ERROR:pika.adapters.utils.connection_workflow:TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.18.0.3', 5672))
rasa-x_1           | ERROR:pika.adapters.utils.connection_workflow:AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-worker_1      | 2020-03-19 12:26:47 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=25, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.18.0.9', 57400)>; error=111 (Connection refused)
rasa-worker_1      | 2020-03-19 12:26:47 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.18.0.3', 5672))
rasa-worker_1      | 2020-03-19 12:26:47 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')
rasa-production_1  | 2020-03-19 12:26:47 ERROR    pika.adapters.utils.io_services_utils  - Socket failed to connect: <socket.socket fd=25, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.18.0.10', 60708)>; error=111 (Connection refused)
rasa-production_1  | 2020-03-19 12:26:47 ERROR    pika.adapters.utils.connection_workflow  - TCP Connection attempt failed: ConnectionRefusedError(111, 'Connection refused'); dest=(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('172.18.0.3', 5672))
rasa-production_1  | 2020-03-19 12:26:47 ERROR    pika.adapters.utils.connection_workflow  - AMQPConnector - reporting failure: AMQPConnectorSocketConnectError: ConnectionRefusedError(111, 'Connection refused')

Hi @sidkgp, did you restart RAsa X after adding the socketio channel? And what url have you provided to the website chat widget?

Those errors can be ignored, as long as they only show up on startup and not continuously.

I m facing the same issue with all socket.io, telegram and slack. Messages sent by user are reported in rasa x conversation but rasa x is not responding

1 Like

Thanks @akelad. Yes, I ran “sudo docker-compose up -d”. For the chatbot widget. I replaced the the ngrok url with the url of the RasaX server. It is working with ngrok, but it is not working with RasaX. Initially, the ngrok solution needed me to run “rasa run --cors “*”” to fix an issue with cors. Not sure if that is relevant. Given multiple people are facing this issue, would you be able to see if this error can be replicated and provide a possible solution?

@sidkgp what does the url you’re using look like? We definitely have this working with our bot “Sara” on our docs and that’s hooked up to Rasa X.

Thanks @akelad. I just replaced the ngrok url below with url of the server. I get a 502 error.

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
// Or you can replace latest with a specific version
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/get_started",
    customData: {"language": "en"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "https://04688d4a.ngrok.io",
    socketPath: "/socket.io/",
    title: "Title",
    subtitle: "Subtitle",
  })
</script>

A 502 indicates an issue with the server - can you access the Rasa X UI from the browser at all?

And could you send the logs of rasa-production?