paulpierre / RasaGPT

💬 RasaGPT is the first headless LLM chatbot platform built on top of Rasa and Langchain. Built w/ Rasa, FastAPI, Langchain, LlamaIndex, SQLModel, pgvector, ngrok, telegram
https://rasagpt.dev
MIT License
2.35k stars 227 forks source link

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

Open adamengberg opened 1 year ago

adamengberg commented 1 year ago

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:

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

Ngrok agent service

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

ngrok: image: ngrok/ngrok:latest container_name: chat_ngrok ports:

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

Core Rasa service

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

rasa-core: image: rasa/rasa:latest container_name: chat_rasa_core env_file:

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

Rasa actions service

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

rasa-actions: build: context: ./app/rasa dockerfile: ./actions/Dockerfile container_name: chat_rasa_actions env_file:

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

Rasa credentials helper service

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

rasa-credentials: build: context: ./app/rasa-credentials dockerfile: Dockerfile container_name: chat_rasa_credentials volumes:

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

Postgres database service

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

db: build: context: ./app/db container_name: chat_db env_file:

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

PgAdmin database browser service

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

pgadmin: container_name: chat_pgadmin image: dpage/pgadmin4 environment: PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org} PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} PGADMIN_CONFIG_SERVER_MODE: 'False' volumes:

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

Container log viewer service

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

dozzle: container_name: chat_dozzle image: amir20/dozzle:latest volumes:

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!

wmv commented 1 year ago

Also getting this issue, across 3 different linux environments.

akisayaka commented 1 year ago

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

jamixlee commented 1 year ago

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