Rasa: Server sends response once and doesn't respond on subsequent calls.

Created on 7 Oct 2019  ยท  9Comments  ยท  Source: RasaHQ/rasa

Rasa version:
Rasa 1.3.7

Rasa X version (if used & relevant):

Python version:
Python 3.6.8

Operating system (windows, osx, ...):
Ubuntu 18.04.3 LTS

Issue:

  1. I run the Rasa server like so rasa run -m models/20191007-115129.tar.gz --enable-api --log-file out.log
  2. I receive the following output:
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
2019-10-07 14:55:33 INFO     root  - Generating grammar tables from /usr/lib/python3.6/lib2to3/Grammar.txt
2019-10-07 14:55:33 INFO     root  - Generating grammar tables from /usr/lib/python3.6/lib2to3/PatternGrammar.txt
2019-10-07 14:55:36 INFO     root  - Starting Rasa server on http://localhost:5005
  1. I do a curl like so: curl -H "Content-Type:application/json" -X POST -d '{"sender": "Batman", "message":"do not message me"}' "http://localhost:5005/webhooks/rest/webhook"
  2. I get the proper response: [{"recipient_id":"Batman","text":"My sincere apologies. I will take you off the list right away!"}]
  3. I do a curl again like so: curl -H "Content-Type:application/json" -X POST -d '{"sender": "Batman", "message":"do not message me"}' "http://localhost:5005/webhooks/rest/webhook"
  4. And I get an empty response: []
  5. The first curl's log on the server is:
[2019-10-07 14:58:43 +0530] [13345] [ERROR] Exception occurred in one of response middleware handlers
Traceback (most recent call last):
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic/app.py", line 958, in handle_request
    request, response
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/spf/framework.py", line 579, in _run_response_middleware
    _response = await _response
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/extension.py", line 267, in unapplied_cors_response_middleware
    set_cors_headers(req, resp, context, res_options)
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 254, in set_cors_headers
    headers_to_set = get_cors_headers(options, req.headers, req.method)
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 174, in get_cors_headers
    origins_to_set = get_cors_origins(options, request_headers.get('Origin'))
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 149, in get_cors_origins
    return sorted([o for o in origins if not probably_regex(o)])
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 149, in <listcomp>
    return sorted([o for o in origins if not probably_regex(o)])
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 273, in probably_regex
    return any((c in maybe_regex for c in common_regex_chars))
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 273, in <genexpr>
    return any((c in maybe_regex for c in common_regex_chars))
TypeError: argument of type 'NoneType' is not iterable

And the second curl has the same one:

Traceback (most recent call last):
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic/app.py", line 958, in handle_request
    request, response
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/spf/framework.py", line 579, in _run_response_middleware
    _response = await _response
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/extension.py", line 267, in unapplied_cors_response_middleware
    set_cors_headers(req, resp, context, res_options)
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 254, in set_cors_headers
    headers_to_set = get_cors_headers(options, req.headers, req.method)
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 174, in get_cors_headers
    origins_to_set = get_cors_origins(options, request_headers.get('Origin'))
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 149, in get_cors_origins
    return sorted([o for o in origins if not probably_regex(o)])
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 149, in <listcomp>
    return sorted([o for o in origins if not probably_regex(o)])
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 273, in probably_regex
    return any((c in maybe_regex for c in common_regex_chars))
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 273, in <genexpr>
    return any((c in maybe_regex for c in common_regex_chars))
TypeError: argument of type 'NoneType' is not iterable

Error (including full traceback):

Traceback (most recent call last):
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic/app.py", line 958, in handle_request
    request, response
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/spf/framework.py", line 579, in _run_response_middleware
    _response = await _response
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/extension.py", line 267, in unapplied_cors_response_middleware
    set_cors_headers(req, resp, context, res_options)
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 254, in set_cors_headers
    headers_to_set = get_cors_headers(options, req.headers, req.method)
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 174, in get_cors_headers
    origins_to_set = get_cors_origins(options, request_headers.get('Origin'))
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 149, in get_cors_origins
    return sorted([o for o in origins if not probably_regex(o)])
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 149, in <listcomp>
    return sorted([o for o in origins if not probably_regex(o)])
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 273, in probably_regex
    return any((c in maybe_regex for c in common_regex_chars))
  File "/home/haris/.virtualenvs/rasa/lib/python3.6/site-packages/sanic_cors/core.py", line 273, in <genexpr>
    return any((c in maybe_regex for c in common_regex_chars))
TypeError: argument of type 'NoneType' is not iterable

Command or request that led to error:

Executing the following curl twice:
`curl -H "Content-Type:application/json" -X POST -d '{"sender": "Batman", "message":"do not message me"}' "http://localhost:5005/webhooks/rest/webhook"`

Content of configuration file (config.yml) (if relevant):

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline: supervised_embeddings

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: MemoizationPolicy
  - name: KerasPolicy
  - name: MappingPolicy

Content of domain file (domain.yml) (if relevant):

intents:
  - wrong_number
  - just_browsing

actions:
- utter_apologies
- utter_marketing

templates:
  utter_apologies:
  - text: "My sincere apologies. I will take you off the list right away!"

  utter_marketing:
  - text: "Ah, do carry on and please don't hesitate to reach out for any help!"
type

Most helpful comment

Its fixed in rasa 1.3.9 thank you!

All 9 comments

Thanks for the issue, @tmbo will get back to you about it soon!

You may find help in the docs and the forum, too ๐Ÿค—

Update:

Just in case there is curiosity about executing the rest/webhook call twice with different messages, I've tried:

(unreal) โžœ  django git:(test-rasa) โœ— curl -H "Content-Type:application/json" -X POST -d '{"sender": "Batman", "message":"do not message me"}' "http://localhost:5005/webhooks/rest/webhook"

[{"recipient_id":"Batman","text":"My sincere apologies. I will take you off the list right away!"}]

(unreal) โžœ  django git:(test-rasa) โœ— curl -H "Content-Type:application/json" -X POST -d '{"sender": "Batman", "message":"do not message me"}' "http://localhost:5005/webhooks/rest/webhook"

[]%

(unreal) โžœ  django git:(test-rasa) โœ— curl -H "Content-Type:application/json" -X POST -d '{"sender": "Batman", "message":"browsing for fun"}' "http://localhost:5005/webhooks/rest/webhook"

[]%

I also tried parse-ing the same message multiple times to see if there were any difference in the confidence levels or intent classification and I couldn't find any:

(unreal) โžœ  django git:(test-rasa) โœ— curl -H "Content-Type:application/json" -X POST -d '{"text":"Im just browsing for fun."}' "http://localhost:5005/model/parse"

{"intent":{"name":"just_browsing","confidence":1.0},"entities":[],"intent_ranking":[{"name":"just_browsing","confidence":1.0},{"name":"wrong_number","confidence":0.0}],"text":"Im just browsing for fun."}%

(unreal) โžœ  django git:(test-rasa) โœ— curl -H "Content-Type:application/json" -X POST -d '{"text":"Im just browsing for fun."}' "http://localhost:5005/model/parse"

{"intent":{"name":"just_browsing","confidence":1.0},"entities":[],"intent_ranking":[{"name":"just_browsing","confidence":1.0},{"name":"wrong_number","confidence":0.0}],"text":"Im just browsing for fun."}%

(unreal) โžœ  django git:(test-rasa) โœ— curl -H "Content-Type:application/json" -X POST -d '{"text":"Im just browsing for fun."}' "http://localhost:5005/model/parse" 

{"intent":{"name":"just_browsing","confidence":1.0},"entities":[],"intent_ranking":[{"name":"just_browsing","confidence":1.0},{"name":"wrong_number","confidence":0.0}],"text":"Im just browsing for fun."}%

@harisibrahimkv actually we just released a version yesterday that fixes it - please try out 1.3.8

Environment:
OS:
Windows 10 pro
I run the rasa shell using rasa shell as given on https://rasa.com/docs/rasa/user-guide/rasa-tutorial/

I have version 1.3.8 for rasa:
image

but I still see:
image

@sushrutt12 Hey, I get the same error. Ran the Rasa shell according to the instructions given in the tutorial.
Rasa version 1.3.8
OS : Windows 10
Please let me know if you figure out the solution

@akelad Just tried it with 1.3.8 and the issue still persists. If you need any more specific information to help you debug other than what I have already given in the issue, please do ask.

@wochinge are you sure this was actually fixed?

Its fixed in rasa 1.3.9 thank you!

was a changelog mistake... we since moved the fix to the 1.3.9 changelog :)

Was this page helpful?
0 / 5 - 0 ratings