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

Created on 19 Nov 2019  路  17Comments  路  Source: RasaHQ/rasa

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!

area normal stale type

Most helpful comment

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.

All 17 comments

i am facing the same issue, creared an ubuntu lts vm in azure and tried to install rasa using docker

Thanks for the issue, @tmbo will get back to you about it soon!

You may find help in the docs and the forum, too 馃

Puh, no idea where this is coming from - @aleerizw, do you know what might be causing this?

@miohana: why are you running rasa init in the first place if all you want to do is deploy an already trained model?

@tmbo because I was following rasa instructions, with the command located here, in the section _Setup_:

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

With what I saw in the documentation, I need to create a docker image with an empty rasa and add my pretrained model after.

@erohmensing this seems to be a docs issue then as well as a permission one. Because it is not necessary to run rasa init in the container to deploy a model.

Got it, will give it an update. I reckon if you already have a rasa model, as long as it is in the models/ folder, you can skip to Running the Rasa Server, @tmbo sound good?

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.

i am facing the same issue

Same issue here

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).

I am facing the same Issue even after i give the permissions to the folder.
docker run -v $(pwd):/app rasa/rasa init --no-prompt
The create Commands works but it does not seem to create the Models folder due to which i am not able to run the Shell Command:-
docker run -it -v $(pwd):/app rasa/rasa shell
Please Rectify the Issue if anyone has resolved the specific problem.

Hi, this error could be fixed by modifying Dockerfile.
Please refer this(https://github.com/RasaHQ/rasa/pull/5298).
Then, docker build -t <your image name>:latest .
And restart it.

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 馃憤

The create Commands works but it does not seem to create the Models folder due to which i am not able to run the Shell Command:-

Interesting, I ran into this as well. When I ran into the general permission error on Ubuntu, the -u root fixed it, and correctly created the models folder. But I can't get the models folder to appear on CentOS, even if I run the train command in the container as root. We'll keep looking into this, but I'll change the name of the issue, as the original issue (deploying a locally trained model) is resolved.

@erohmensing Can you reproduce the error? If yes can you give me the steps/commands that you executed? Additionally, a version of docker, image, CentOS will be useful.

I've checked the latest docker image (rasa/rasa) with CentOS 7 Core using docker with root permission and I couldn't reproduce the same behavior that you described :)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed due to inactivity. Please create a new issue if you need more help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikhilcss97 picture nikhilcss97  路  3Comments

nicolasfarina picture nicolasfarina  路  3Comments

yondu22 picture yondu22  路  3Comments

mit4dev picture mit4dev  路  4Comments

nahidalam picture nahidalam  路  3Comments