Permission denied: /usr/local/bin/docker-entrypoint.sh: line 66: /home/frappe/frappe-bench/sites/apps.txt

Hello,

I’m trying to install via Single Bench Docker instance. Here’s the error I’m getting:

config file not created, retry 31
timeout: config file not created
/usr/local/bin/docker-entrypoint.sh: line 66: /home/frappe/frappe-bench/sites/apps.txt: Permission denied
config file not created, retry 1

Here’s my docker-compose.yml file:

version: "3"

services:
  erpnext-public-nginx:
    image: nginx
    restart: on-failure
    ports:
      - "8082:8082"
    volumes:
      - /docker/erpnext/nginx.conf:/etc/nginx/conf.d/default.conf

  erpnext-nginx:
    image: frappe/erpnext-nginx:${ERPNEXT_VERSION}
    restart: on-failure
    environment:
      - FRAPPE_PY=erpnext-python
      - FRAPPE_PY_PORT=8000
      - FRAPPE_SOCKETIO=frappe-socketio
      - SOCKETIO_PORT=9000
      - SKIP_NGINX_TEMPLATE_GENERATION=${SKIP_NGINX_TEMPLATE_GENERATION}
    volumes:
      - sites-vol:/var/www/html/sites:rw
      - assets-vol:/assets:rw

  erpnext-python:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
    restart: on-failure
    environment:
      - MARIADB_HOST=${MARIADB_HOST}
      - REDIS_CACHE=redis-cache:6379
      - REDIS_QUEUE=redis-queue:6379
      - REDIS_SOCKETIO=redis-socketio:6379
      - SOCKETIO_PORT=9000
      - AUTO_MIGRATE=1
      - WORKER_CLASS=${WORKER_CLASS}
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - assets-vol:/home/frappe/frappe-bench/sites/assets:rw

  frappe-socketio:
    image: frappe/frappe-socketio:${FRAPPE_VERSION}
    restart: on-failure
    depends_on:
      - redis-socketio
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw

  erpnext-worker-default:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
    restart: on-failure
    command: worker
    depends_on:
      - redis-queue
      - redis-cache
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw

  erpnext-worker-short:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
    restart: on-failure
    command: worker
    environment:
      - WORKER_TYPE=short
    depends_on:
      - redis-queue
      - redis-cache
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw

  erpnext-worker-long:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
    restart: on-failure
    command: worker
    environment:
      - WORKER_TYPE=long
    depends_on:
      - redis-queue
      - redis-cache
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw

  erpnext-schedule:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
    restart: on-failure
    command: schedule
    depends_on:
      - redis-queue
      - redis-cache
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw

  redis-cache:
    image: redis:latest
    restart: on-failure
    volumes:
      - redis-cache-vol:/data

  redis-queue:
    image: redis:latest
    restart: on-failure
    volumes:
      - redis-queue-vol:/data

  redis-socketio:
    image: redis:latest
    restart: on-failure
    volumes:
      - redis-socketio-vol:/data

  mariadb:
    image: mariadb:10.3
    restart: on-failure
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
    volumes:
      - ./installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf
      - mariadb-vol:/var/lib/mysql

  site-creator:
    image: frappe/erpnext-worker:${ERPNEXT_VERSION}
    restart: "no"
    command: new
    depends_on:
      - erpnext-python
    environment:
      - SITE_NAME=${SITE_NAME}
      - DB_ROOT_USER=${DB_ROOT_USER}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - INSTALL_APPS=${INSTALL_APPS}
    volumes:
      - sites-vol:/home/frappe/frappe-bench/sites:rw
      - logs-vol:/home/frappe/frappe-bench/logs:rw

volumes:
  mariadb-vol:
  redis-cache-vol:
  redis-queue-vol:
  redis-socketio-vol:
  assets-vol:
  sites-vol:
  cert-vol:
  logs-vol:

Any hints? Thank you

the sites volumes should have permission for uid:gid / 1000:1000

use non root account or set volume permissions

I tried to add the PUID:1000 and PGID:1000 at the end of the env for the site-creator container and it still has the same problem. I have it behind a Nginex Reverse proxy pointing to the internal IP:80. Please help.

it is not set using .env file. You’ve to set it with chown -R 1000:1000 /path/to/volume command. Exec into erpnext-nginx container using entrypoint as bash and run that command or on docker host/NFS Server where the volume is present.

I was able to fix it. I used the chown -R 1000:1000 on the local location of the folder.

STEPS:

  1. I use portainer to locate the volume local/host path and then ssh into the location and enter the chown -R 1000:1000 /path/to/volume.
  2. docker-compose down (all the stack containers)
  3. chown -R 1000:1000 /path/to/volume
  4. docker-compose up -d (all the stack containers)

Voilà!

I hope it helps others.

1 Like

@jrd2017 @revant_one I got the issue:

The problem is caused because the :rw added into volumes:

Example:

volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
networks:
  - frappe-network

Solution: remove :rw

volumes:
  - sites-vol:/home/frappe/frappe-bench/sites:rw
networks:
  - frappe-network 

And it will workd.

Regards.