Rasa server not starting

Hi,

I just upgraded to Rasa version 1.6.0 from 1.3 and now starting the Rasa server is taking a long time. I’m trying to connect through a rest endpoint configured to connect to localhost, but even after 10 minutes of waiting I’m still getting an error like this:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001F016CA8B38>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

I see these messages for initializing the server:

2019-12-26 12:55:54 DEBUG    rasa.model  - Extracted model to '<redacted>'.
2019-12-26 12:55:55 DEBUG    sanic.root  - CORS: Configuring CORS with resources: {'/*': {'origins': [''], 'methods': 'DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT', 'allow_headers': ['.*'], 'expose_headers': None, 'supports_credentials': True, 'max_age': None, 'send_wildcard': False, 'automatic_options': True, 'vary_header': True, 'resources': {'/*': {'origins': ''}}, 'intercept_exceptions': True, 'always_send': True}}
2019-12-26 12:55:55 DEBUG    rasa.core.utils  - Available web server routes:
/webhooks/rest                                     GET                            custom_webhook_RestInput.health
/webhooks/rest/webhook                             POST                           custom_webhook_RestInput.receive
/                                                  GET                            hello
2019-12-26 12:55:55 INFO     root  - Starting Rasa server on http://localhost:5002
2019-12-26 12:55:55 DEBUG    rasa.core.utils  - Using the default number of Sanic workers (1).
2019-12-26 12:55:55 INFO     root  - Enabling coroutine debugging. Loop id 2131341203216.
2019-12-26 12:55:55 DEBUG    rasa.model  - Extracted model to '<redacted>'.
initialised the class
2019-12-26 12:56:43 INFO     rasa.nlu.components  - Added 'SpacyNLP' to component cache. Key 'SpacyNLP-en'.
2019-12-26 12:56:43 DEBUG    rasa.core.tracker_store  - Connected to InMemoryTrackerStore.
2019-12-26 12:56:43 DEBUG    rasa.core.lock_store  - Connected to lock store 'InMemoryLockStore'.
2019-12-26 12:56:43 DEBUG    rasa.model  - Extracted model to '<redacted>'.
2019-12-26 12:56:43 DEBUG    pykwalify.compat  - Using yaml library: <redacted>
2019-12-26 12:56:43.921054: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2019-12-26 12:56:43.929643: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2019-12-26 12:56:43.941690: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: <redacted>
2019-12-26 12:56:43.950021: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: <redacted>
2019-12-26 12:56:43.954230: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2019-12-26 12:56:45 DEBUG    rasa.core.nlg.generator  - Instantiated NLG to 'TemplatedNaturalLanguageGenerator'.```

I tried running rasa shell but I still get a connection refused error. I’m aware that this error means the server isn’t up, but I don’t see any errors for why the server is taking so long to start. I haven’t made any changes to my domain.yml or other config files since I upgraded. Would someone be able to help with this issue?

Thanks

I tried waiting for 20 mins and noticed that it seems to be registering the message but then it refuses the rest:

2019-12-26 13:52:46 DEBUG    rasa.core.tracker_store  - Creating a new tracker for id 'test'.
2019-12-26 13:52:46 DEBUG    rasa.core.processor  - Starting a new session for conversation ID 'test'.
2019-12-26 13:52:46 DEBUG    rasa.core.processor  - Action 'action_session_start' ended with events '[<rasa.core.events.SessionStarted object at 0x000001C7C6A29C18>, <rasa.core.events.ActionExecuted object at 0x000001C7C6A29BE0>]'.
2019-12-26 13:52:46 DEBUG    rasa.core.processor  - Current slot values:
        requested_slot: None
        target: None
        user: User
        verify_target: False
2019-12-26 13:52:47 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'test'.
2019-12-26 13:52:47 ERROR    rasa.core.channels.channel  - An exception occured while handling user message 'hi'.
Traceback (most recent call last):
  File "c:\targetbot\env\lib\site-packages\urllib3\connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "c:\targetbot\env\lib\site-packages\urllib3\util\connection.py", line 80, in create_connection
    raise err
  File "c:\targetbot\env\lib\site-packages\urllib3\util\connection.py", line 70, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\targetbot\env\lib\site-packages\urllib3\connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "c:\targetbot\env\lib\site-packages\urllib3\connectionpool.py", line 355, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "c:\python36\Lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "c:\python36\Lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "c:\python36\Lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "c:\python36\Lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "c:\python36\Lib\http\client.py", line 964, in send
    self.connect()
  File "c:\targetbot\env\lib\site-packages\urllib3\connection.py", line 183, in connect
    conn = self._new_conn()
  File "c:\targetbot\env\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001C7C6A132B0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\targetbot\env\lib\site-packages\requests\adapters.py", line 449, in send
    timeout=timeout
  File "c:\targetbot\env\lib\site-packages\urllib3\connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "c:\targetbot\env\lib\site-packages\urllib3\util\retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C7C6A132B0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\targetbot\env\lib\site-packages\rasa\core\channels\channel.py", line 487, in receive
    metadata=metadata,
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\channels\channel.py", line 83, in handler
    await app.agent.handle_message(*args, **kwargs)
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\agent.py", line 486, in handle_message
    return await processor.handle_message(message)
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\processor.py", line 90, in handle_message
    tracker = await self.log_message(message, should_save_tracker=False)
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\processor.py", line 216, in log_message
    await self._handle_message_with_tracker(message, tracker)
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\processor.py", line 413, in _handle_message_with_tracker
    parse_data = await self._parse_message(message, tracker)
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\processor.py", line 392, in _parse_message
    message.text, message.message_id, tracker
  File "c:\python36\Lib\asyncio\coroutines.py", line 110, in __next__
    return self.gen.send(None)
  File "c:\targetbot\env\lib\site-packages\rasa\core\interpreter.py", line 288, in parse
    result = self.interpreter.parse(text, message_id)
  File "c:\targetbot\env\lib\site-packages\rasa\nlu\model.py", line 376, in parse
    component.process(message, **self.context)
  File "C:\targetbot\custom_components\target_extractor.py", line 96, in process
    response = requests.get("http://127.0.0.1:8000/status")
  File "c:\targetbot\env\lib\site-packages\requests\api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "c:\targetbot\env\lib\site-packages\requests\api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "c:\targetbot\env\lib\site-packages\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\targetbot\env\lib\site-packages\requests\sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "c:\targetbot\env\lib\site-packages\requests\adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C7C6A132B0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

I reverted back to the old version and I have no issues. Would someone be able to comment if there are any changes with configuration that I need to add that could help resolve this issue?

Thanks

I feel a bit silly, but this line should have told me what the issue was: requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /status (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C7C6A132B0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it',))

Turns out that because the API I have setup was inaccessible, it was causing the request to time out. I had assumed that if it was down it would be caught properly through status codes, but I will need to handle for this exception.