question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Docker] - Rasa init error

See original GitHub issue

Rasa version: Latest (1.4.1) - See on Docker Hub

Docker & docker-compose versions: Docker version 19.03.4, build 9013bf583a docker-compose version 1.24.1, build 4667896b

Operating system (windows, osx, …): Ubuntu 18.04.3 LTS

Issue: With a brand new installation of Docker, dating from the day, it is impossible to launch rasa commands (init, train_nlu, …) via Docker as described in the docs.

I tried with an empty current directory and a non-empty current directory (where volume is mounted) : the result is the same, leading to the error below.

I am connected as root, so the problem is not due to rights or anything else (about ten other diverse containers are currently working without any problem on the same machine)

Note: I have never encountered this problem with previous versions of the rasa:latest and rasa_latest-full images.

Error (including full traceback):

root@xyz:/path/to/my/project# docker run -v $(pwd):/app rasa/rasa:latest init --no-prompt
Unable to find image 'rasa/rasa:latest' locally
latest: Pulling from rasa/rasa
[...]
Status: Downloaded newer image for rasa/rasa:latest
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/dir_util.py", line 70, in mkpath
    os.mkdir(head, mode)
PermissionError: [Errno 13] Permission denied: '__pycache__'

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 159, in copy_tree
    verbose=verbose, dry_run=dry_run))
  File "/usr/local/lib/python3.6/distutils/dir_util.py", line 135, in copy_tree
    mkpath(dst, verbose=verbose)
  File "/usr/local/lib/python3.6/distutils/dir_util.py", line 74, in mkpath
    "could not create '%s': %s" % (head, exc.args[-1]))
distutils.errors.DistutilsFileError: could not create '__pycache__': Permission denied

Command or request that led to error:

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

or

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

Thanks in advance and best regards TBX

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
eprabhakarcommented, Jan 4, 2020

Thanks to @AndiLeni for posting the link of the rasa forum where the issue is posted, and @ArjaanBuijk for giving a simple solution in the forum, that worked excellent for me. I am just posting it here for the convenience,


> Solution by @ArjaanBuijk 

This is how it looks for me, on Ubuntu 18.04, when I am inside the folder
 where I will install the mood-bot:

$ stat .
  File: .
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d	Inode: 5119770     Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/  arjaan)   Gid: ( 1000/  arjaan)
Access: 2019-12-24 10:10:38.261990864 -0500
Modify: 2019-12-24 10:03:55.915369626 -0500
Change: 2019-12-24 10:03:55.915369626 -0500
 Birth: -

As you can see, access rights for the folder are for uid=1000.

So, running docker container as the user with uid=1000 will work:

$ sudo docker run --user 1000 -v $(pwd):/app rasa/rasa init --no-prompt
0reactions
CaptXiongcommented, Jun 4, 2020

cd your_dir stat . checke the uid permission of the dir. if you dont have permission,then mkdir, do as the tutorial

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rasa init error · Issue #4653 · RasaHQ/rasa - Docker - GitHub
via Docker as described in the docs. I tried with an empty current directory and a non-empty current directory (where volume is mounted)...
Read more >
Running rasa on docker not working
When I executed below command. docker run -v myrasa:/app rasa/rasa init. I am getting the following errors. Welcome to Rasa!
Read more >
getting error when try to run "rasa x" in terminal using ...
If you want to run rasa x locally on a windows machine, then I would recommend using docker and wsl2. From your Rasa...
Read more >
Understanding Rasa Deployments - Intro to Docker - YouTube
This video will show you how to run Rasa in a Docker container by building on from scratch.
Read more >
Create Chatbot using Rasa Part-1 - Towards Data Science
“rasa init” should show above message, in-case you are doing well and your system doesn't contain any error. Follow the interactive session and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found