Webchat Failed to load resource: net::ERR_CONNECTION_REFUSED

  1. credentials.yaml has following
rest:
#  # you don't need to provide anything here - this channel doesn't
#  # require any credentials


#facebook:
#  verify: "<verify>"
#  secret: "<your secret>"
#  page-access-token: "<your page access token>"

#slack:
#  slack_token: "<your slack token>"
#  slack_channel: "<the slack channel>"

#socketio:
#  user_message_evt: <event name for user message>
#  bot_message_evt: <event name for but messages>
#  session_persistence: <true/false>

        #pass

rasa:
  url: "http://localhost:5002/api"

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true/false
  1. Started rasa core with following
 rasa run --credentials credentials.yml
/usr/local/lib/python3.6/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2019-10-24 04:48:45 INFO     root  - Generating grammar tables from /usr/lib/python3.6/lib2to3/Grammar.txt
2019-10-24 04:48:45 INFO     root  - Generating grammar tables from /usr/lib/python3.6/lib2to3/PatternGrammar.txt
2019-10-24 04:48:46 INFO     engineio.server  - Server initialized for sanic.
2019-10-24 04:48:46 INFO     root  - Starting Rasa server on http://localhost:5005
  1. Running the actions server with following
 rasa run actions
/usr/local/lib/python3.6/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2019-10-24 04:31:14 INFO     rasa_sdk.endpoint  - Starting action endpoint server...
2019-10-24 04:31:14 INFO     rasa_sdk.executor  - Registered function for 'action_network'.
2019-10-24 04:31:14 INFO     rasa_sdk.executor  - Registered function for 'action_dns'.
2019-10-24 04:31:14 INFO     rasa_sdk.executor  - Registered function for 'action_node'.
2019-10-24 04:31:14 INFO     rasa_sdk.executor  - Registered function for 'action_cni'.
2019-10-24 04:31:14 INFO     rasa_sdk.endpoint  - Action endpoint is up and running on http ('0.0.0.0', 5055)
  1. Index.html has following.
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.8.js"></script>
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/get_started",
    interval: 1000, // 1000 ms between each message
    customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5005",
    socketPath: "/socket.io/",
    title: "KK",
    subtitle: "BT",
    inputTextFieldHint: "Type a message...",
    connectingText: "Waiting for server...",
    hideWhenNotConnected: false,
    fullScreenMode: false,
    showFullScreenButton: false,
    profileAvatar: "http://to.avat.ar",
    openLauncherImage: 'myCustomOpenImage.png',
    closeLauncherImage: 'myCustomCloseImage.png',
    displayUnreadCount: true, // --> [view](./assets/unread_count_pastille.png)
    params: {
      images: {
        dims: {
          width: 300,
          height: 200,
        }
      },
      storage: "local"
    },
  })
</script>
</body>
</html>
  1. WebChat UI say cannot connect with

  2. Developer UI tool of chrome reported. image

Let me know how to resolve this issue ?

1 Like

I suspect the issue is with your credentials.yml, the part that says true/false should be just true or just false.

Can you please edit that and then run with rasa run --credentials credentials.yml --enable-api --debug?

Thanks @amn41 for the response. The issue was my browser was from my laptop while the rasa was running on my server. Resolving that solved the problem…

Thanks again.

Have you solved this problem? I have the same problem.

1 Like

Yes, me too!

Hi,

Using Kubernetes/quick install script, where i should the following command to enable API and CORS: rasa run --enable-api --cors “*”