Error after every entry in rasa shell

When I run my bot via rasa shell and I type in anything, even if it’s a perfectly identified intent, I receive this error before the bot responds (the bot goes on to respond correctly, but the error is there every time):

Exception occurred in one of response middleware handlers
Traceback (most recent call last):
  File "c:\programdata\anaconda3\lib\site-packages\sanic\app.py", line 958, in handle_request
    request, response
  File "c:\programdata\anaconda3\lib\site-packages\spf\framework.py", line 579, in _run_response_middleware
    _response = await _response
  File "c:\programdata\anaconda3\lib\site-packages\sanic_cors\extension.py", line 267, in unapplied_cors_response_middleware
    set_cors_headers(req, resp, context, res_options)
  File "c:\programdata\anaconda3\lib\site-packages\sanic_cors\core.py", line 254, in set_cors_headers
    headers_to_set = get_cors_headers(options, req.headers, req.method)
  File "c:\programdata\anaconda3\lib\site-packages\sanic_cors\core.py", line 174, in get_cors_headers
    origins_to_set = get_cors_origins(options, request_headers.get('Origin'))
  File "c:\programdata\anaconda3\lib\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 "c:\programdata\anaconda3\lib\site-packages\sanic_cors\core.py", line 149, in <listcomp>
    return sorted([o for o in origins if not probably_regex(o)])
  File "c:\programdata\anaconda3\lib\site-packages\sanic_cors\core.py", line 273, in probably_regex
    return any((c in maybe_regex for c in common_regex_chars))
  File "c:\programdata\anaconda3\lib\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

What causes this and how can I solve it? Thanks.

Hi @ggabor,

this error seems to be known and discussed here.

Regards Julian

1 Like

Thank you! Indeed the solution provided there (adding --cors '*' as argument) solved it.