lludlow / autogen-studio

Autogen studio docker
66 stars 16 forks source link

PermissionError: [Errno 13] Permission denied: '/app/.autogenstudio/files/' #51

Closed fahadshery closed 4 weeks ago

fahadshery commented 1 month ago

Hi,

here is my docker-compose.yml file:

services:
  autogen-studio:
    image: ghcr.io/lludlow/autogen-studio
    environment:
      - OPENAI_API_KEY=YOUR_API_KEY
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - ./data:/app/.autogenstudio
    # ports:
    #   - 8081:8081
    restart: unless-stopped
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.autogen-studio.rule=Host(`autogen.local.example.com`)"
      - "traefik.http.routers.autogen-studio.entrypoints=https"
      - "traefik.http.routers.autogen-studio.tls=true"
      - "traefik.http.routers.autogen-studio.tls.certresolver=cloudflare"
      - "traefik.http.services.autogen-studio.loadbalancer.server.port=8081"
      - "traefik.http.routers.autogen-studio.middlewares=default-headers@file"

networks:
  traefik:
    external: true

I am getting the error:

snip...
│   276 │   files_static_root = os.path.join(app_root, "files/")               │
│   277 │   static_folder_root = os.path.join(app_file_path, "ui")             │
│   278 │                                                                      │
│ ❱ 279 │   os.makedirs(files_static_root, exist_ok=True)                      │
│   280 │   os.makedirs(os.path.join(files_static_root, "user"), exist_ok=True │
│   281 │   os.makedirs(static_folder_root, exist_ok=True)                     │
│   282 │   folders = {                                                        │
│                                                                              │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
│ │      app_file_path = '/app/venv/lib/python3.10/site-packages/autogenstu… │ │
│ │           app_root = '/app/.autogenstudio'                               │ │
│ │           env_file = '/app/.autogenstudio/.env'                          │ │
│ │  files_static_root = '/app/.autogenstudio/files/'                        │ │
│ │ static_folder_root = '/app/venv/lib/python3.10/site-packages/autogenstu… │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
│                                                                              │
│ /usr/local/lib/python3.10/os.py:225 in makedirs                              │
│                                                                              │
│    222 │   │   if tail == cdir:           # xxx/newdir/. exists if xxx/newdi │
│    223 │   │   │   return                                                    │
│    224 │   try:                                                              │
│ ❱  225 │   │   mkdir(name, mode)                                             │
│    226 │   except OSError:                                                   │
│    227 │   │   # Cannot rely on checking for EEXIST, since the operating sys │
│    228 │   │   # could give priority to other errors like EACCES or EROFS    │
│                                                                              │
│ ╭──────────────── locals ─────────────────╮                                  │
│ │ exist_ok = True                         │                                  │
│ │     head = '/app/.autogenstudio'        │                                  │
│ │     mode = 511                          │                                  │
│ │     name = '/app/.autogenstudio/files/' │                                  │
│ │     tail = 'files'                      │                                  │
│ ╰─────────────────────────────────────────╯                                  │
╰──────────────────────────────────────────────────────────────────────────────╯
PermissionError: [Errno 13] Permission denied: '/app/.autogenstudio/files/'
fahadshery commented 1 month ago

I created a data directory in the project's directory and changed the owner ship to 999:999. Then started the container and it works.

another thing I noticed is that in your requirements.txt file. The pyautogen is pinned to the 0.3.0 version. when I exec into the container...it's changed to the pyautogen==0.2.35 why?

docker exec -it autogen-studio-autogen-studio-1 /bin/bash
autogen@d868af01bd8b:~$ cat requirements.txt
pydantic
fastapi
typer
uvicorn
arxiv
pyautogen==0.2.35
autogenstudio==0.1.5
lludlow commented 1 month ago

try pulling latest and check the permissions on your data dir. Maybe docker is not running as 999 or your users uid is not 999

fahadshery commented 4 weeks ago

try pulling latest and check the permissions on your data dir. Maybe docker is not running as 999 or your users uid is not 999

My default uid is 1000 and gid is 1000 on ubuntu server. this is what most linux id defaults to

lludlow commented 4 weeks ago

you are pre-creating the directory so you will need to ensure the permissions are correct. I suggest you move this into a volume or relax the permissions on the data directory.