Running rasa on docker not working

I was not able to run rasa on docker. When I executed below command

docker run -v myrasa:/app rasa/rasa init

I am getting the following errors.

Welcome to Rasa! πŸ€–

To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.
Now let's start! πŸ‘‡πŸ½

Warning: Output is not to a terminal (fd=1).
Warning: Input is not to a terminal (fd=0).
Traceback (most recent call last):
  File "/build/bin/rasa", line 8, in <module>
sys.exit(main())
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
cmdline_arguments.func(cmdline_arguments)
  File "/build/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 184, in run
.skip_if(args.no_prompt, default=".")
  File "/build/lib/python3.6/site-packages/questionary/question.py", line 45, in ask
return self.unsafe_ask(patch_stdout)
  File "/build/lib/python3.6/site-packages/questionary/question.py", line 59, in unsafe_ask
return self.application.run()
  File "/build/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 736, in run
return run()
  File "/build/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 710, in run
return f.result()
  File "/build/lib/python3.6/site-packages/prompt_toolkit/eventloop/future.py", line 151, in result
raise self._exception
  File "/build/lib/python3.6/site-packages/prompt_toolkit/eventloop/coroutine.py", line 92, in step_next
new_f = coroutine.throw(exc)
  File "/build/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 685, in _run_async2
result = yield f
  File "/build/lib/python3.6/site-packages/prompt_toolkit/eventloop/coroutine.py", line 88, in step_next
new_f = coroutine.send(None)
  File "/build/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 625, in _run_async
with self.input.attach(read_from_input):
  File "/usr/local/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
  File "/build/lib/python3.6/site-packages/prompt_toolkit/input/vt100.py", line 150, in _attached_input
loop.add_reader(fd, callback)
  File "/build/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py", line 273, in add_reader
self.selector.register(fd)
  File "/build/lib/python3.6/site-packages/prompt_toolkit/eventloop/select.py", line 78, in register
sel.register(fd)
  File "/build/lib/python3.6/site-packages/prompt_toolkit/eventloop/select.py", line 133, in register
self._sel.register(fd, selectors.EVENT_READ, None)
  File "/usr/local/lib/python3.6/selectors.py", line 412, in register
self._epoll.register(key.fd, epoll_events)
PermissionError: [Errno 1] Operation not permitted

Can anyone help me in fixing this? Thanks you in advance.

Use docker run -v myrasa:/app rasa/rasa init --no-prompt instead of docker run -v myrasa:/app rasa/rasa init and it should work!

I tried this even. But model is not getting trained. Its getting stopped after the following output.

Warning: Output is not to a terminal (fd=1).
Warning: Input is not to a terminal (fd=0).
Processed Story Blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:00<00:00, 2628.67it/s, # trackers=1]

Then try out this command: docker run -it -v myrasa:/app rasa/rasa init --no-prompt

I get a similar error when trying to run it in docker on Mac Os. Without Docker everything works fine.

$ docker run -it -v $(pwd):/app rasa/rasa init --no-prompt Welcome to Rasa! :robot:

To get started quickly, an initial project will be created. If you need some help, check out the documentation at Build contextual chatbots and AI assistants with Rasa.

Created project directory at β€˜/app’. Finished creating project structure. Training an initial model… 2020-02-13 11:43:54 INFO rasa.model - Data (core-config) for Core model section changed. Training Core model… Processed Story Blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:00<00:00, 1596.49it/s, # trackers=1] Processed Story Blocks: 0%| | 0/5 [00:00<?, ?it/s, # trackers=5]

Then it exits.

Thanks in advance!

And similar when trying to train.

$ docker run -v $(pwd):/app rasa/rasa train

$ INFO rasa.model - Data (core-config) for Core model section changed. Processed Story Blocks: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 5/5 [00:00<00:00, 1226.91it/s, # trackers=1] Processed Story Blocks: 0%| | 0/5 [00:00<?, ?it/s, # trackers=5]%

Then it exits again.

And when I try to run it doesn’t exit the terminal command but http://localhost:5005 is not reachable.

$ docker run -v $(pwd):/app rasa/rasa run $ INFO root - Starting Rasa server on http://localhost:5005

Thank you!

Do you have the latest version of the rasa? Pull the latest Docker Rasa image with docker pull rasa/rasa:latest. And if you want to run the Rasa Server with Docker you need map a port from the Docker container to a port from your local PC. So just use docker run -v $(pwd):/app -p 5005:5005 rasa/rasa run instead of docker run -v $(pwd):/app rasa/rasa run.

Thank you that worked. Now I can connect and get the β€œHello from Rasa: 1.7.0” message.

Hi, did you solve the training part?

I posted the same problem here: