rasa-webchat icon indicating copy to clipboard operation
rasa-webchat copied to clipboard

Webchat has no reply with newest core version

Open kc-shilin opened this issue 6 years ago • 3 comments

Hi, i have an issue with rasa-webchat It keeps saying GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t= ... 400 11 Need some instructions!

My goal is simply to test medicare_locator with rasa-webchat using websockets GitHub link of Medicare Locator: https://github.com/RasaHQ/medicare_locator

[Environment]

Ubuntu 16.04 LTS
Python 3.6.10

[Rasa version]

rasa  0.15.0a1 
rasa-core-sdk  0.14.0
rasa-nlu  0.15.1

[Install command]

pip install git+git://github.com/RasaHQ/rasa_core.git

Train Core:

python3 -m rasa.core.train -d domain.yml -s data/core -o models/current/dialogue -c core_config.yml

Train NLU:

python3  -m rasa_nlu.train -c nlu_config.yml --data data/nlu_data.md -o models --fixed_model_name nlu --project current --verbose

Action server:

python3 -m rasa_core_sdk.endpoint --actions actions

Run Core:

python3 -m rasa.core.run -d models/current/dialogue -u models/current/nlu --port 5002 --credentials credentials.yml --cors '*' --enable_api --endpoints endpoints.yml --debug

[File] endpoints.yml

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

[File] credentials.yml

socketio: 
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: true

[File] index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Demo for Medicare Locator UI</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>

<body for="html-export">

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.4.1.js"></script>
<script>
    WebChat.default.init({
        selector: "#webchat",
        initPayload: "/get_started",
        interval: 1000, // 1000 ms between each message
        customData: {"language": "en"},
        socketUrl: "http://localhost:5002",
        socketPath: "/socket.io/",
        title: "Medicare Locator",
        subtitle: "Demo",
        inputTextFieldHint: "Type a message...",
        connectingText: "Waiting for server...",
        profileAvatar: "robotic.png",
        hideWhenNotConnected: false,
        showCloseButton: true,
        fullScreenMode: false
    })
</script>
</body>
</html>

[Problem description] I clicked the html file and got no response

[Log]

python3 -m rasa.core.run -d models/current/dialogue -u models/current/nlu --port 5002 --credentials credentials.yml --cors '*' --enable_api --endpoints endpoints.yml --debug

2020-04-17 13:16:33 DEBUG    rasa.core.utils  - Available web server routes: 
/conversations/<sender_id>/tracker/events          POST                           append_event
/finetune                                          POST                           continue_training
/intentEvaluation                                  POST                           evaluate_intents
/evaluate                                          POST                           evaluate_stories
/conversations/<sender_id>/execute                 POST                           execute_action
/domain                                            GET                            get_domain
/socket.io                                         OPTIONS                        handle_request
/                                                  GET                            hello
/conversations                                     GET                            list_trackers
/model                                             POST                           load_model
/conversations/<sender_id>/messages                POST                           log_message
/parse                                             POST                           parse
/conversations/<sender_id>/predict                 POST                           predict
/conversations/<sender_id>/tracker/events          PUT                            replace_events
/conversations/<sender_id>/respond                 GET                            respond
/conversations/<sender_id>/story                   GET                            retrieve_story
/conversations/<sender_id>/tracker                 GET                            retrieve_tracker
/webhooks/socketio                                 GET                            socketio_webhook.health
/status                                            GET                            status
/predict                                           POST                           tracker_predict
/jobs                                              POST                           train_stack
/version                                           GET                            version
2020-04-17 13:16:33 INFO     root  - Starting Rasa Core server on http://localhost:5002
[2020-04-17 13:16:33 +0800] [32343] [INFO] Goin' Fast @ http://0.0.0.0:5002
2020-04-17 13:16:33 INFO     sanic.root  - Goin' Fast @ http://0.0.0.0:5002
2020-04-17 13:16:33 INFO     root  - Enabling coroutine debugging. Loop id 92257576
2020-04-17 13:16:34 INFO     rasa_nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.

[2020-04-17 13:16:35 +0800] [32343] [INFO] Starting worker [32343]
2020-04-17 13:16:35 INFO     sanic.root  - Starting worker [32343]
2020-04-17 13:16:41 WARNING  asyncio  - Executing <TimerHandle functools.partial(<function update_current_time at 0x7f5e406c2158>, <uvloop.Loop running=True closed=False debug=True>) created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:547> took 0.001 seconds
2020-04-17 13:19:12 WARNING  asyncio  - Executing <TimerHandle functools.partial(<function update_current_time at 0x7f5e406c2158>, <uvloop.Loop running=True closed=False debug=True>) created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:547> took 0.001 seconds
[2020-04-17 13:19:55 +0800] - (sanic.access)[INFO][127.0.0.1:43354]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66b47h  400 11
2020-04-17 13:19:55 INFO     sanic.access  - 
2020-04-17 13:19:55 WARNING  asyncio  - Executing <Task finished coro=<SanicPluginsFramework._handle_request() done, defined at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:549> result=None created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.003 seconds
[2020-04-17 13:19:56 +0800] - (sanic.access)[INFO][127.0.0.1:43354]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66b4V8  400 11
2020-04-17 13:19:56 INFO     sanic.access  - 
2020-04-17 13:19:56 WARNING  asyncio  - Executing <Task finished coro=<SanicPluginsFramework._handle_request() done, defined at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:549> result=None created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.005 seconds
[2020-04-17 13:19:59 +0800] - (sanic.access)[INFO][127.0.0.1:43354]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66b5Al  400 11
2020-04-17 13:19:59 INFO     sanic.access  - 
2020-04-17 13:19:59 WARNING  asyncio  - Executing <Task finished coro=<SanicPluginsFramework._handle_request() done, defined at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:549> result=None created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.001 seconds
[2020-04-17 13:20:03 +0800] - (sanic.access)[INFO][127.0.0.1:43354]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66b62r  400 11

I done quick survey on Issues Some one suggested that I can replace my channels/socketio.py with github latest one. After this work, I got 200 119 but still no reply

[Log]

python3 -m rasa.core.run -d models/current/dialogue -u models/current/nlu --port 5002 --credentials credentials.yml --cors '*' --enable_api --endpoints endpoints.yml --debug

2020-04-17 13:39:33 DEBUG    rasa.core.utils  - Available web server routes: 
/conversations/<sender_id>/tracker/events          POST                           append_event
/finetune                                          POST                           continue_training
/intentEvaluation                                  POST                           evaluate_intents
/evaluate                                          POST                           evaluate_stories
/conversations/<sender_id>/execute                 POST                           execute_action
/domain                                            GET                            get_domain
/socket.io                                         OPTIONS                        handle_request
/                                                  GET                            hello
/conversations                                     GET                            list_trackers
/model                                             POST                           load_model
/conversations/<sender_id>/messages                POST                           log_message
/parse                                             POST                           parse
/conversations/<sender_id>/predict                 POST                           predict
/conversations/<sender_id>/tracker/events          PUT                            replace_events
/conversations/<sender_id>/respond                 POST                           respond
/conversations/<sender_id>/story                   GET                            retrieve_story
/conversations/<sender_id>/tracker                 GET                            retrieve_tracker
/webhooks/socketio                                 GET                            socketio_webhook.health
/status                                            GET                            status
/predict                                           POST                           tracker_predict
/jobs                                              POST                           train_stack
/version                                           GET                            version
2020-04-17 13:39:33 INFO     root  - Starting Rasa Core server on http://localhost:5002
[2020-04-17 13:39:33 +0800] [2968] [INFO] Goin' Fast @ http://0.0.0.0:5002
2020-04-17 13:39:33 INFO     sanic.root  - Goin' Fast @ http://0.0.0.0:5002
2020-04-17 13:39:33 INFO     root  - Enabling coroutine debugging. Loop id 99316104
2020-04-17 13:39:34 INFO     rasa_nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.

[2020-04-17 13:39:35 +0800] [2968] [INFO] Starting worker [2968]
2020-04-17 13:39:35 INFO     sanic.root  - Starting worker [2968]
2020-04-17 13:39:41 DEBUG    rasa.core.channels.socketio  - User 73dba9fc52214ba3b15e5e2793528bae connected to socketIO endpoint.
2020-04-17 13:39:41 WARNING  asyncio  - Executing <Task pending coro=<SanicPluginsFramework._handle_request() running at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:554> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fe5243d4bb8>()] created at /usr/lib/python3.6/asyncio/tasks.py:341> created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.003 seconds
[2020-04-17 13:39:41 +0800] - (sanic.access)[INFO][127.0.0.1:51530]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66fbiK  200 119
2020-04-17 13:39:41 INFO     sanic.access  - 
2020-04-17 13:39:41 WARNING  asyncio  - Executing <Handle <TaskWakeupMethWrapper object at 0x7fe5243d4bb8> created at /usr/lib/python3.6/asyncio/tasks.py:318> took 0.001 seconds
2020-04-17 13:39:42 DEBUG    rasa.core.channels.socketio  - User b8a8dc62ea8c4e7987292b378b97878f connected to socketIO endpoint.
2020-04-17 13:39:42 WARNING  asyncio  - Executing <Task pending coro=<SanicPluginsFramework._handle_request() running at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:554> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fe5243d4bb8>()] created at /usr/lib/python3.6/asyncio/tasks.py:341> created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.005 seconds
[2020-04-17 13:39:42 +0800] - (sanic.access)[INFO][127.0.0.1:51530]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66fbro  200 119
2020-04-17 13:39:42 INFO     sanic.access  - 
2020-04-17 13:39:42 WARNING  asyncio  - Executing <Handle <TaskWakeupMethWrapper object at 0x7fe5243d4bb8> created at /usr/lib/python3.6/asyncio/tasks.py:318> took 0.002 seconds
2020-04-17 13:39:44 DEBUG    rasa.core.channels.socketio  - User 0bcfde58f51142a2a59488b6ea844a71 connected to socketIO endpoint.
2020-04-17 13:39:44 WARNING  asyncio  - Executing <Task pending coro=<SanicPluginsFramework._handle_request() running at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:554> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fe5243d4bb8>()] created at /usr/lib/python3.6/asyncio/tasks.py:341> created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.005 seconds
[2020-04-17 13:39:44 +0800] - (sanic.access)[INFO][127.0.0.1:51530]: GET http://localhost:5002/socket.io/?EIO=3&transport=polling&t=N66fcQ-  200 119
2020-04-17 13:39:44 INFO     sanic.access  - 
2020-04-17 13:39:44 WARNING  asyncio  - Executing <Handle <TaskWakeupMethWrapper object at 0x7fe5243d4bb8> created at /usr/lib/python3.6/asyncio/tasks.py:318> took 0.002 seconds
2020-04-17 13:39:48 DEBUG    rasa.core.channels.socketio  - User 06269c8f72454613b7f101937d49dac2 connected to socketIO endpoint.
2020-04-17 13:39:48 WARNING  asyncio  - Executing <Task pending coro=<SanicPluginsFramework._handle_request() running at /home/kc/Rasa/vn/lib/python3.6/site-packages/spf/framework.py:554> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fe5243d4bb8>()] created at /usr/lib/python3.6/asyncio/tasks.py:341> created at /home/kc/Rasa/vn/lib/python3.6/site-packages/sanic/server.py:333> took 0.005 seconds

I'm new to use websockets Maybe I'm missing something important here Any pointers or suggestions would be very welcome, thanks!

kc-shilin avatar Apr 17 '20 05:04 kc-shilin

Problem solved

kc-shilin avatar Apr 22 '20 04:04 kc-shilin

Problem solved

Hello, how did you solve the issue?.

Thanks for the comments in advance.

frivas-at-navteca avatar Apr 23 '20 18:04 frivas-at-navteca

Problem solved

Hello, how did you solve the issue?.

Thanks for the comments in advance.

Just got it I ran rasa run --cors "*"

Problem solved. :D

frivas-at-navteca avatar Apr 23 '20 18:04 frivas-at-navteca