rasa: After upgrade rasa from v2.1.3 to v2.2.1, local rasa x server doesn't work

Rasa version: 2.2.1

Rasa SDK version (if used & relevant): 2.2.0

Rasa X version (if used & relevant): 0.34.0

Python version: 3.8.6

Operating system (windows, osx, …): macOS Big Sur version 11.1

Issue: After upgrade rasa from v2.1.3 to v2.2.1, local rasa x server doesn’t work. Only after I edited rasa cli source code, it did work.

# rasa/cli/x.py
# line 493 ~ 499
local.main(
            args,
            project_path,
            args.data,
            token=rasa_x_token,
            config_path=config_path
            # domain_path=domain_path # I removed it!
        )

Error (including full traceback):

(venv) (base) ➜  rasa git:(feature/prototype) ✗ rasa x
Traceback (most recent call last):
  File "/Users/ys/dev/rasa/venv/lib/python3.8/site-packages/rasa/cli/x.py", line 493, in run_locally
    local.main(
TypeError: main() got an unexpected keyword argument 'domain_path'

Sorry, something went wrong (see error above). Make sure to start Rasa X with valid data and valid domain and config files. Please, also check any warnings that popped up.
If you need help fixing the issue visit our forum: https://forum.rasa.com/.
(venv) (base) ➜  rasa git:(feature/prototype) ✗ rasa x --v
Traceback (most recent call last):
  File "/Users/ys/dev/rasa/venv/lib/python3.8/site-packages/rasa/cli/x.py", line 493, in run_locally
    local.main(
TypeError: main() got an unexpected keyword argument 'domain_path'

Sorry, something went wrong (see error above). Make sure to start Rasa X with valid data and valid domain and config files. Please, also check any warnings that popped up.
If you need help fixing the issue visit our forum: https://forum.rasa.com/.

Command or request that led to error:

rasa x

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

I can confirm that the above problem does indeed continue to occur, and in fact it is two different problems. I can also confirm that I am working in a virtual environment and that I reinstalled the entire venv from scratch to check this issue.

To sum it up the two issues are

  1. the domain_path issue that started this thread
  2. an issue with an invalid handle that occurs even if the domain_path issue is dealt with correctly. This handle issue seems to be special to the Windows installation of rasa-x and does not occur on Ubuntu 18.04.

The handle issue occurs even if we comment out the code as suggested above. In that case (of commenting out the line of code) the traceback changes slightly.

Furthermore (not shown below to avoid confusion) even if I downgrade rasa to 2.1.3 while staying with rasa X 0.34 the handle issue continues to come up. So there seems right now to be no working combination of rasa x on Windows 10 (with either python 3.8.5 or 3.7.9). However switching to Ubuntu 18.04 with python 3.6.9 does work.

Please help.

Rasa Version : 2.2.2 Rasa SDK Version : 2.2.0 Rasa X Version : 0.34.0 Python Version : 3.8.5 Operating System : Windows-10-10.0.19041-SP0 Python Path : c:\workspace\py-pip-workspaces\rasa2-examples.venv\scripts\python.exe

So, here first is the traceback without any changes to the code

Traceback (most recent call last):
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasa\cli\x.py", line 494, in run_locally
    local.main(
TypeError: main() got an unexpected keyword argument 'domain_path'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasa\cli\x.py", line 506, in run_locally
    local.main(
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasax\community\local.py", line 233, in main
    _start_event_service()
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasax\community\local.py", line 138, in _start_event_service 
    common_utils.run_in_process(
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasax\community\utils\common.py", line 855, in run_in_process
    p.start()
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\connection.py", line 959, in reduce_pipe_connection
    dh = reduction.DupHandle(conn.fileno(), access)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\connection.py", line 170, in fileno
    self._check_closed()
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
OSError: handle is closed

Sorry, something went wrong (see error above). Make sure to start Rasa X with valid data and valid domain and config files. Please, also check any warnings that popped up.
If you need help fixing the issue visit our forum: https://forum.rasa.com/.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\spawn.py", line 107, in spawn_main  
    new_handle = reduction.duplicate(pipe_handle,
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid

Here is the change I made to the code (as above) In line 500 of file c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasa\cli\x.py:

    # noinspection PyBroadException
    try:
        try:
            local.main(
                args,
                project_path,
                args.data,
                token=rasa_x_token,
                config_path=config_path,
                # domain_path=domain_path,  # <----------------
            )

and here is the traceback after that one-line change

Traceback (most recent call last):
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasa\cli\x.py", line 494, in run_locally
    local.main(
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasax\community\local.py", line 233, in main
    _start_event_service()
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasax\community\local.py", line 138, in _start_event_service 
    common_utils.run_in_process(
  File "c:\workspace\py-pip-workspaces\rasa2-examples\.venv\lib\site-packages\rasax\community\utils\common.py", line 855, in run_in_process
    p.start()
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\connection.py", line 959, in reduce_pipe_connection
    dh = reduction.DupHandle(conn.fileno(), access)
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\connection.py", line 170, in fileno
    self._check_closed()
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
OSError: handle is closed

Sorry, something went wrong (see error above). Make sure to start Rasa X with valid data and valid domain and config files. Please, also check any warnings that popped up.
If you need help fixing the issue visit our forum: https://forum.rasa.com/.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\spawn.py", line 107, in spawn_main  
    new_handle = reduction.duplicate(pipe_handle,
  File "C:\Users\Gilad\miniconda3\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid

To sum it up there seems to be an issue with an invalid handle that occurs even if the domain_path issue is dealt with correctly.

Need some help here. Stuck here for past 2-3 days version error

Did you change the x.py file in the cli folder as was shown above? You can either do that at your own risk, or wait for the next update and I expect atleast the first TypeError will be handled.

I upgraded rasa to 2.2.2 and now getting error shown in picture

Spent my morning debugging this and it was driving me crazy. I can confirm that downgrading to Rasa 2.1 fixes Rasa X.

Is there a way to ensure the version incompatibility between Rasa and Rasa X doesn’t happen again in the future? I believe this happened with the previous version as well, and as a newcomer, it was very frustrating to debug.