Http ParserInvalidURLError on Rasa X running on server

I’m running Rasa X on an Ubuntu 18 server running in Alibaba cloud and it’s throwing these errors from time to time… note that this does not happen to me running locally (macos) or on Ubuntu on AWS.

Any ideas why this might be happening and fix?

File “httptools/parser/parser.pyx”, line 471, in httptools.parser.parser.parse_url httptools.parser.errors.HttpParserInvalidURLError: invalid url b’www.voanews.com:443

File “httptools/parser/parser.pyx”, line 471, in httptools.parser.parser.parse_url httptools.parser.errors.HttpParserInvalidURLError: invalid url b’cn.bing.com:443

File “httptools/parser/parser.pyx”, line 471, in httptools.parser.parser.parse_url httptools.parser.errors.HttpParserInvalidURLError: invalid url b’www.baidu.com:443

@mmm3bbb at what point do these errors show up? Can you paste the full stack trace?

The problem seems to have gone away.

@akelad Nope, it’s still there. Here is the full stack trace.

Traceback (most recent call last):
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 273, in data_received
    self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 193, in httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserCallbackError: the on_headers_complete callback failed
2019-11-08 20:24:48 ERROR    sanic.root  - Exception occurred while handling uri: unknown
Traceback (most recent call last):
  File "httptools/parser/parser.pyx", line 292, in httptools.parser.parser.cb_on_headers_complete
  File "httptools/parser/parser.pyx", line 129, in httptools.parser.parser.HttpParser._on_headers_complete
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 312, in on_headers_complete
    app=self.app,
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/request.py", line 99, in __init__
    self._parsed_url = parse_url(url_bytes)
  File "httptools/parser/parser.pyx", line 471, in httptools.parser.parser.parse_url
httptools.parser.errors.HttpParserInvalidURLError: invalid url b'www.ip.cn:443'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 273, in data_received
    self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 193, in httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserCallbackError: the on_headers_complete callback failed
2019-11-08 23:38:14 ERROR    sanic.root  - Exception occurred while handling uri: unknown
Traceback (most recent call last):
  File "httptools/parser/parser.pyx", line 292, in httptools.parser.parser.cb_on_headers_complete
  File "httptools/parser/parser.pyx", line 129, in httptools.parser.parser.HttpParser._on_headers_complete
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 312, in on_headers_complete
    app=self.app,
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/request.py", line 99, in __init__
    self._parsed_url = parse_url(url_bytes)
  File "httptools/parser/parser.pyx", line 471, in httptools.parser.parser.parse_url
httptools.parser.errors.HttpParserInvalidURLError: invalid url b'www.ip.cn:443'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 273, in data_received
    self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 193, in httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserCallbackError: the on_headers_complete callback failed
2019-11-08 23:38:14 ERROR    sanic.root  - Exception occurred while handling uri: unknown
Traceback (most recent call last):
  File "httptools/parser/parser.pyx", line 292, in httptools.parser.parser.cb_on_headers_complete
  File "httptools/parser/parser.pyx", line 129, in httptools.parser.parser.HttpParser._on_headers_complete
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 312, in on_headers_complete
    app=self.app,
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/request.py", line 99, in __init__
    self._parsed_url = parse_url(url_bytes)
  File "httptools/parser/parser.pyx", line 471, in httptools.parser.parser.parse_url
httptools.parser.errors.HttpParserInvalidURLError: invalid url b'cn.bing.com:443'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 273, in data_received
    self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 193, in httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserCallbackError: the on_headers_complete callback failed
2019-11-08 23:38:18 ERROR    sanic.root  - Exception occurred while handling uri: unknown
Traceback (most recent call last):
  File "httptools/parser/parser.pyx", line 292, in httptools.parser.parser.cb_on_headers_complete
  File "httptools/parser/parser.pyx", line 129, in httptools.parser.parser.HttpParser._on_headers_complete
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 312, in on_headers_complete
    app=self.app,
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/request.py", line 99, in __init__
    self._parsed_url = parse_url(url_bytes)
  File "httptools/parser/parser.pyx", line 471, in httptools.parser.parser.parse_url
httptools.parser.errors.HttpParserInvalidURLError: invalid url b'www.baidu.com:443'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 273, in data_received
    self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 193, in httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserCallbackError: the on_headers_complete callback failed
2019-11-08 23:38:20 ERROR    sanic.root  - Exception occurred while handling uri: unknown
Traceback (most recent call last):
  File "httptools/parser/parser.pyx", line 292, in httptools.parser.parser.cb_on_headers_complete
  File "httptools/parser/parser.pyx", line 129, in httptools.parser.parser.HttpParser._on_headers_complete
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 312, in on_headers_complete
    app=self.app,
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/request.py", line 99, in __init__
    self._parsed_url = parse_url(url_bytes)
  File "httptools/parser/parser.pyx", line 471, in httptools.parser.parser.parse_url
httptools.parser.errors.HttpParserInvalidURLError: invalid url b'www.voanews.com:443'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/fr/venv/lib/python3.6/site-packages/sanic/server.py", line 273, in data_received
    self.parser.feed_data(data)
  File "httptools/parser/parser.pyx", line 193, in httptools.parser.parser.HttpParser.feed_data
httptools.parser.errors.HttpParserCallbackError: the on_headers_complete callback failed
(venv) root@ECS-SH01:~/fr/scenarios/pets_scenario#

but what happens before the error is thrown? Were you uploading data?

I don’t believe it’s related to any user activity. These just get emitted from time to time. My guess is that it’s originating outside of Rasa. I will close the Rasa ports to the internet and see if that stops it.