Error on bind address for Virtual Analyst startup
search cancel

Error on bind address for Virtual Analyst startup

book

Article ID: 272220

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager

Issue/Introduction

Attempting to start the Aria Chatbot and when running rasa_run, seeing the following output

[20XX-XX-XX 22:22:08 -0500] [5056] [ERROR] Unable to start server
Traceback (most recent call last):
  File "e:\va\botenv\lib\site-packages\sanic\server.py", line 860, in serve
    http_server = loop.run_until_complete(server_coroutine)
  File "E:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 584, in run_until_complete
    return future.result()
  File "E:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 1378, in create_server
    % (sa, err.strerror.lower())) from None
OSError: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 5005): only one usage of each socket address (protocol/network address/port) is normally permitted.

Environment

Release : 17.3

CA Service Desk Manager

Cause

There is an existing instance of Aria Virtual Analyst running in the background.  The most likeliest cause is that the native Command Prompt or Powershell window that had been hosting the Virtual Analyst runtime was closed out or was cancelled by pressing Ctrl-C.  This action does not terminate the Virtual Analyst process and may leave the process running in the background and potentially in an unstable state

Ways to tell that there is a rogue Virtual Analyst process:  

- Access "http://ARIA-SERVER:5005" from a web browser.  If you get a response such as this, you still have a running RASA process

Hello from Rasa: 3.0.6

- Another method is to run the command "netstat -ano -p tcp | findstr 5005" on the server where the Virtual Analyst was installed from an Admin command prompt.

If the Virtual Analyst is truly down, there should not be any entries that reference IP address and port 0.0.0.0:5005.  A result which shows that there are such entries would read as:

C:\Users\Administrator>netstat -ano -p tcp | findstr 5005
  TCP    0.0.0.0:5005           0.0.0.0:0              LISTENING       4616

From here, run tasklist |find "XXXX"" command to show what is the associated process.  Substitute XXXX which is the process ID. In the above example, the process ID in question is "4616" and the result will show:

C:\Users\Administrator>tasklist |find "4616"
python.exe                    4616 RDP-Tcp#0                  2  1,557,580 K

The above shows process 4616 is tied to "python.exe" which is the backend executable used for RASA and Aria Chatbot/Virtual Analyst.  If a different binary or executable is presented, please track back to the particular application involved, noting that the application is binding to port 5005 which is nominally reserved for RASA and Aria Chatbot/Virtual Analyst by default.

Resolution

Stop rasa by using the rasa_halt command and run netstat to test that nothing is connected to 5005, then try starting aria back up.  In Anaconda or Python, access the Virtual Analyst folder (C:\VA in the following example), start a new python environment, then run rasa_halt.  ie:

cd c:\va
.\botenv\Scripts\activate
cd casm-bot
.\rasa_halt

Test that there are no entries tied to port 5005 using the above netstat command, then try starting rasa back up using "rasa_train"

One can also consider clearing the backend processes in Task Manager based on the process IDs exposed using the above netstat command, or even reboot the entire server that is hosting the Virtual Analyst.

Additional Information

The above method to address the issue will terminate the existing RASA session and any existing Virtual Analyst processes.  There is no other way to recover from the above scenario.  Please coordinate with the appropriate personnel ahead of such activity.  The approach to test if there is an existing process may be performed without interruption of production.