rasa: Rasa shell error: TypeError: argument of type 'NoneType' is not iterable

Rasa version: 1.3.6

Python version: 3.6.9

Operating system (windows, osx, …): rsa/rasa docker image

Issue: When I’m using the shell and send a message, the following error is displayed. The correct response is displayed after the error but I get the exception.

Error (including full traceback):

Exception occurred in one of response middleware handlers
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 985, in handle_request
    request, response
  File "/usr/local/lib/python3.6/site-packages/spf/framework.py", line 579, in _run_response_middleware
    _response = await _response
  File "/usr/local/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 "/usr/local/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 "/usr/local/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 "/usr/local/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 "/usr/local/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 "/usr/local/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 "/usr/local/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

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 11
  • Comments: 35 (11 by maintainers)

Most upvoted comments

adding --cors '*' to your arguments should fix it, it does for me

fixing it now

This problem disappears when I use Rasa 1.3.3. Here is exactly what I did to install Rasa 1.3.3:

  • Created a new virtual environment using virtualenv with python 3.6.5.
  • Downloaded the Rasa 1.3.3 source code from the official release here.
  • Followed the installation steps described here.

@teresalazar13, hope this can help

adding --cors ā€˜*’ definitely Help! 😃

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

You may find help in the docs and the forum, too šŸ¤—

I am also facing the same issue and downgrading is not an option as rasa X will not otherwise.

(rasa_env) E:\Work\AI_And_Iot\CHAT BOTS\RASA\restorent_test_chat_bot>rasa train 2020-09-22 10:12:53 INFO rasa.model - Data (messages) for NLU model section changed. Core stories/configuration did not change. No need to retrain Core model. Training NLU model... Traceback (most recent call last): File "c:\users\nares\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\nares\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\Work\AI_And_Iot\CHAT BOTS\RASA\rasa_env\Scripts\rasa.exe\__main__.py", line 7, in <module> File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\__main__.py", line 92, in main cmdline_arguments.func(cmdline_arguments) File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\cli\train.py", line 76, in train additional_arguments=extract_additional_arguments(args), File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\train.py", line 50, in train additional_arguments=additional_arguments, File "c:\users\nares\appdata\local\programs\python\python36\lib\asyncio\base_events.py", line 484, in run_until_complete return future.result() File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\train.py", line 101, in train_async additional_arguments, File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\train.py", line 188, in _train_async_internal additional_arguments=additional_arguments, File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\train.py", line 245, in _do_training persist_nlu_training_data=persist_nlu_training_data, File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\train.py", line 482, in _train_nlu_with_validated_data persist_nlu_training_data=persist_nlu_training_data, File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\nlu\train.py", line 75, in train trainer = Trainer(nlu_config, component_builder) File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\nlu\model.py", line 142, in __init__ components.validate_requirements(cfg.component_names) File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\nlu\components.py", line 51, in validate_requirements component_class = registry.get_component_class(component_name) File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\nlu\registry.py", line 173, in get_component_class return class_from_module_path(component_name) File "e:\work\ai_and_iot\chat bots\rasa\rasa_env\lib\site-packages\rasa\utils\common.py", line 208, in class_from_module_path if "." in module_path: TypeError: argument of type 'NoneType' is not iterable

RASA VERSIONS ARE:

rasa 1.10.12 rasa-sdk 1.10.2 rasa-x 0.32.2 redis 3.5.3 regex 2020.6.8 requests 2.24.0 requests-oauthlib 1.3.0 requests-toolbelt 0.9.1 rfc3986 1.4.0 rocketchat-API 0.6.36 rsa 4.6 ruamel.yaml 0.16.12 ruamel.yaml.clib 0.2.0 s3transfer 0.3.3 sacremoses 0.0.43 sanic 19.12.2 Sanic-Cors 0.10.0.post3 sanic-jwt 1.3.2

tensorboard 2.1.1 tensorflow 2.1.1 tensorflow-addons 0.7.1 tensorflow-estimator 2.1.0 tensorflow-hub 0.7.0 tensorflow-probability 0.7.0 termcolor 1.1.0