rasa: Cannot train model in docker on centOS; models folder not created (silent failure)

Rasa version: using docker-full-latest

Operating system (windows, osx, …): CentOS Linux 7 (Core)

Issue: I’m trying to deploy my locally trained model to remote server using docker to run the pretrained model from local machine.

Error (including full traceback):

Command:

$ sudo docker run -v $(pwd):/app rasa/rasa init --no-prompt

Traceback:

Warning: Output is not to a terminal (fd=1).
Warning: Input is not to a terminal (fd=0).
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.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/distutils/file_util.py", line 41, in _copy_file_contents
    fdst = open(dst, 'wb')
PermissionError: [Errno 13] Permission denied: './__init__.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/bin/rasa", line 11, in <module>
    load_entry_point('rasa==1.5.0a1', 'console_scripts', 'rasa')()
  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 195, in run
    init_project(args, path)
  File "/build/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 111, in init_project
    create_initial_project(path)
  File "/build/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 119, in create_initial_project
    copy_tree(scaffold_path(), path)
  File "/usr/local/lib/python3.6/distutils/dir_util.py", line 163, in copy_tree
    dry_run=dry_run)
  File "/usr/local/lib/python3.6/distutils/file_util.py", line 151, in copy_file
    _copy_file_contents(src, dst)
  File "/usr/local/lib/python3.6/distutils/file_util.py", line 44, in _copy_file_contents
    "could not create '%s': %s" % (dst, e.strerror))
distutils.errors.DistutilsFileError: could not create './__init__.py': Permission denied

Thanks in advance!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

replacedocker run -v $(pwd):/app rasa/rasa init --no-prompt with docker run -v myrasa:/app rasa/rasa init --no-prompt ,then it will create a dir at /www/server/docker/volumes,it works.

Hi everyone, for this command, that creates new files and directories, the user (1001) apparently does not have permission to create these files in the local directory.

If you already have models, you don’t need to use rasa init to deploy a model. If you are creating a new one, you can use the -u flag to let this one command act as root to create files.

docker run -v $(pwd):/app -u root rasa/rasa init --no-prompt

Plan to clear this up in the documentation 👍

It seems to be a problem of writing permission for the $(pwd) directory. If I give permissions to write contents to $(pwd) or any directory you want to use than sudo docker run -v $(pwd):/app rasa/rasa init --no-prompt works fine and can create the corresponding files in the $(pwd).