RasaGPT icon indicating copy to clipboard operation
RasaGPT copied to clipboard

#8 3.476 ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/opt/venv/lib/python3.10/site-packages/dotenv'

Open adamengberg opened this issue 1 year ago โ€ข 3 comments

Hi, I need some help getting this running, been trying for the last couple of days without success.

Iยดll outline the steps Iยดve gone through and the fixes Iยดve applied.

  1. Im on Windows 10, so Iยดve made the changes suggested in the updated "Readme", changing the image to rasa/rasa:latest in the "docker-compose" and the "Dockerfile" in "app/api". This solves the "service api declares mutually exclusive network_mode and networks: invalid compose project" as a result of running "make install"
  2. Running "make install" here results in the following error: "Error response from daemon: Container f961d9eb78d99976626287f9cbe674c75ddb4104292be40a2df2cf504cb4e35b is not running". The "chat_rasa_core" image is shut down after startup while the other images are running. In Docker logs of "chat_rasa_core" this message shows: "chmod: changing permissions of '/app/wait-for-it.sh': Operation not permitted". I tried to resolve this by changing this line in the "docker-compose"-file:

entrypoint: ["/bin/bash", "-c", "chmod +x /app/wait-for-it.sh && /app/wait-for-it.sh rasa-credentials:8889 -t 120 -o && rasa run --enable-api --cors '*' --debug --credentials /app/credentials.yml --endpoints /app/endpoints.yml --model /app/models"] to: entrypoint: ["/bin/bash", "-c", "/app/wait-for-it.sh rasa-credentials:8889 -t 120 -o && rasa run --enable-api --cors '*' --debug --credentials /app/credentials.yml --endpoints /app/endpoints.yml --model /app/models"] I also go to the RasaGPT/app/scripts directory via Git Bash and run "chmod +x /wait-for-it.sh"

Apart from this, I also need to change the "EOL Conversion" to "Unix (LF)" of the "wait-for-it.sh" file in app/scripts.

I also made the changes in docker-compose suggested here: https://github.com/PythonicNinja/RasaGPT/commit/f899209d01615507a6e9f2aec6cd4d4877d02dea

All in all, this is my docker-compose file: `# -------------------------------------

โ–’โ–ˆโ–€โ–€โ–ˆ โ–ˆโ–€โ–€โ–ˆ โ–ˆโ–€โ–€ โ–ˆโ–€โ–€โ–ˆ โ–’โ–ˆโ–€โ–€โ–ˆ โ–’โ–ˆโ–€โ–€โ–ˆ โ–€โ–€โ–ˆโ–€โ–€

โ–’โ–ˆโ–„โ–„โ–€ โ–ˆโ–„โ–„โ–ˆ โ–€โ–€โ–ˆ โ–ˆโ–„โ–„โ–ˆ โ–’โ–ˆโ–‘โ–„โ–„ โ–’โ–ˆโ–„โ–„โ–ˆ โ–‘โ–’โ–ˆโ–‘โ–‘

โ–’โ–ˆโ–‘โ–’โ–ˆ โ–€โ–‘โ–‘โ–€ โ–€โ–€โ–€ โ–€โ–‘โ–‘โ–€ โ–’โ–ˆโ–„โ–„โ–ˆ โ–’โ–ˆโ–‘โ–‘โ–‘ โ–‘โ–’โ–ˆโ–‘โ–‘

+-----------------------------------+

| http://RasaGPT.dev by @paulpierre |

+-----------------------------------+

version: '3.9'

services:

-------------------

API service for LLM

-------------------

api: build: context: ./app/api restart: always container_name: chat_api env_file: - .env ports: - 8888:8888 healthcheck: test: ["CMD", "curl", "-f", "http://api:8888/health"] interval: 15s retries: 5 depends_on: - db networks: - chat-network volumes: - ./app/scripts/wait-for-it.sh:/app/api/wait-for-it.sh - ./app/api:/app/api

-------------------

Ngrok agent service

-------------------

ngrok: image: ngrok/ngrok:latest container_name: chat_ngrok ports: - 4040:4040 env_file: - .env environment: NGROK_CONFIG: /etc/ngrok.yml NGROK_AUTH_TOKEN: ${NGROK_AUTH_TOKEN:-} NGROK_DEBUG: ${NGROK_DEBUG:-true} NGROK_API_KEY: ${NGROK_API_KEY:-} networks: - chat-network volumes: - ./app/rasa/ngrok.yml:/etc/ngrok.yml restart: unless-stopped

-----------------

Core Rasa service

-----------------

rasa-core: image: rasa/rasa:latest container_name: chat_rasa_core env_file: - .env volumes: - ./app/rasa:/app - ./app/scripts/wait-for-it.sh:/app/wait-for-it.sh

ports:
  - 5005:5005
entrypoint: ["/bin/bash", "-c", "/app/wait-for-it.sh rasa-credentials:8889 -t 120 -o && rasa run --enable-api --cors '*' --debug --credentials /app/credentials.yml --endpoints /app/endpoints.yml --model /app/models"]

networks:
  - chat-network
depends_on:
  - rasa-actions
  - rasa-credentials

--------------------

Rasa actions service

--------------------

rasa-actions: build: context: ./app/rasa dockerfile: ./actions/Dockerfile container_name: chat_rasa_actions env_file: - .env ports: - 5055:5055 depends_on: - rasa-credentials networks: - chat-network

-------------------------------

Rasa credentials helper service

-------------------------------

rasa-credentials: build: context: ./app/rasa-credentials dockerfile: Dockerfile container_name: chat_rasa_credentials volumes: - ./app/rasa:/app/rasa - ./app/rasa-credentials:/app/rasa-credentials ports: - 8889:8889 env_file: - .env networks: - chat-network healthcheck: test: ["CMD", "curl", "-f", "http://rasa-credentials:8889"] interval: 15s retries: 5

-------------------------

Postgres database service

-------------------------

db: build: context: ./app/db container_name: chat_db env_file: - .env environment: POSTGRES_USER: ${POSTGRES_USER:-postgres} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} volumes: - ./mnt/db:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD", "pg_isready", "-U", "postgres"] interval: 5s retries: 5 networks: - chat-network

--------------------------------

PgAdmin database browser service

--------------------------------

pgadmin: container_name: chat_pgadmin image: dpage/pgadmin4 environment: PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]} PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} PGADMIN_CONFIG_SERVER_MODE: 'False' volumes: - ./mnt/pgadmin:/var/lib/pgadmin ports: - "${PGADMIN_PORT:-5050}:80" restart: unless-stopped depends_on: - db networks: - chat-network

----------------------------

Container log viewer service

----------------------------

dozzle: container_name: chat_dozzle image: amir20/dozzle:latest volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - 9999:8080 depends_on: - db

networks: chat-network: driver: bridge`

When running "make install" after these changes, the "chat_rasa_core" stays open without any errors.

  1. Instead this error comes up: "#5 CANCELED failed to solve: process "/bin/bash -o pipefail -c pip install python-dotenv rasa-sdk requests" did not complete successfully: exit code:1"

#8 3.476 ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/opt/venv/lib/python3.10/site-packages/dotenv'

This error i can not get around. It seems to arise when the "requirements.txt" in app/api is ran. Iยดve tried manually installing it via the terminal in Docker, getting the same response. Iยดve also tried modifying the "Dockerfile" in app/api to give it root privileges, like this:

USER root RUN pip install --no-cache-dir -r requirements.txt

Still the same error. I would very much appreciate some help in getting further!

adamengberg avatar May 10 '23 19:05 adamengberg

Also getting this issue, across 3 different linux environments.

wmv avatar May 23 '23 15:05 wmv

I'm working on CentOS7.6. The below command works for me.

#add user:root to all in docker-compose.yml and app/rasa/actions/Dockerfile, then mkdir -p /app/rasa/.rasa/ sudo chmod -R 777 ./app/rasa/.rasa/ make install make run

akisayaka avatar May 30 '23 02:05 akisayaka

I solved this issue by adding USER root in the Dockerfile. Hope this also can help you.

jamixlee avatar Sep 05 '23 08:09 jamixlee