Skip to content

Folder permissions issue prevents deployment with docker #2900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
VivaPitagoras opened this issue Apr 8, 2025 · 0 comments
Open

Folder permissions issue prevents deployment with docker #2900

VivaPitagoras opened this issue Apr 8, 2025 · 0 comments

Comments

@VivaPitagoras
Copy link

I am unable to deploy seafile using docker an all appears to be a problem with user permissions.

First, I was getting this error:

Error: the user running the script ("root") is not the owner of "/shared/seafile/seafile-data" folder, you should use the user "ubuntu" to run the script.
Traceback (most recent call last):
  File "/scripts/start.py", line 94, in <module>
    main()
  File "/scripts/start.py", line 79, in main
    call('{} start'.format(get_script('seafile.sh')))
  File "/scripts/utils.py", line 70, in call
    return subprocess.check_call(*a, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-12.0.11/seafile.sh start' returned non-zero exit status 255.

So I set NON_ROOT=true but now I am getting:

*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 21
*** Running /scripts/enterpoint.sh...
2025-04-07 07:13:27 Waiting Nginx 
2025-04-07 07:13:27 Nginx ready 
2025-04-07 07:13:27 Create linux user seafile in container, please wait. 
2025-04-07 07:13:28 The permission of path seafile/ is incorrect. 
2025-04-07 07:13:28 To use non root, run [ chmod -R a+rwx /opt/seafile-data/seafile/ ] and try again later, now quit. 
*** /scripts/enterpoint.sh exited with status 1.
*** Shutting down runit daemon (PID 21)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
*** Killing all processes...

Is there a way to solve this that do not involve a+rwx?

This is my compose file:

services:
  seafile-mysql:
    image: ${SEAFILE_DB_IMAGE:-mariadb:10.11}
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${INIT_SEAFILE_MYSQL_ROOT_PASSWORD:-}
      - MYSQL_LOG_CONSOLE=true
      - MARIADB_AUTO_UPGRADE=1
    volumes:
      - "${SEAFILE_MYSQL_VOLUME:-/opt/seafile-mysql/db}:/var/lib/mysql"

    networks:
      - starrnet
    healthcheck:
      test:
        [
          "CMD",
          "/usr/local/bin/healthcheck.sh",
          "--connect",
          "--mariadbupgrade",
          "--innodb_initialized",
        ]
      interval: 20s
      start_period: 30s
      timeout: 5s
      retries: 10

  seafile-memcached:
    image: ${SEAFILE_MEMCACHED_IMAGE:-memcached:1.6.29}
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - starrnet

  seafile:
    image: ${SEAFILE_IMAGE:-seafileltd/seafile-mc:12.0-latest}
    container_name: seafile
    # ports:
    #   - "80:80"
    volumes:
      - ${SEAFILE_VOLUME:-/opt/seafile-data}:/shared
    environment:
      - DB_HOST=${SEAFILE_MYSQL_DB_HOST:-seafile-mysql}
      - DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
      - DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
      - DB_ROOT_PASSWD=${INIT_SEAFILE_MYSQL_ROOT_PASSWORD:-}
      - DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
      - SEAFILE_MYSQL_DB_CCNET_DB_NAME=${SEAFILE_MYSQL_DB_CCNET_DB_NAME:-ccnet_db}
      - SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=${SEAFILE_MYSQL_DB_SEAFILE_DB_NAME:-seafile_db}
      - SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=${SEAFILE_MYSQL_DB_SEAHUB_DB_NAME:-seahub_db}
      - TIME_ZONE=${TIME_ZONE:-Etc/UTC}
      - INIT_SEAFILE_ADMIN_EMAIL=${INIT_SEAFILE_ADMIN_EMAIL:-me@example.com}
      - INIT_SEAFILE_ADMIN_PASSWORD=${INIT_SEAFILE_ADMIN_PASSWORD:-asecret}
      - SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
      - SEAFILE_SERVER_PROTOCOL=${SEAFILE_SERVER_PROTOCOL:-http}
      - SITE_ROOT=${SITE_ROOT:-/}
      - NON_ROOT=${NON_ROOT:-false}
      - JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
      - SEAFILE_LOG_TO_STDOUT=${SEAFILE_LOG_TO_STDOUT:-false}
      - ENABLE_SEADOC=${ENABLE_SEADOC:-true}
      - SEADOC_SERVER_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}/sdoc-server
    depends_on:
      seafile-mysql:
        condition: service_healthy
      seafile-memcached:
        condition: service_started
    networks:
      - starrnet

networks:
  starrnet:
    external: true

This is my .env:

COMPOSE_FILE='seafile.yml,seadoc.yml'
COMPOSE_PATH_SEPARATOR=','


SEAFILE_IMAGE=seafileltd/seafile-mc:12.0-latest
SEAFILE_DB_IMAGE=mariadb:10.11
SEAFILE_MEMCACHED_IMAGE=memcached:1.6.29
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9-alpine

SEAFILE_VOLUME=/mnt/docs
SEAFILE_MYSQL_VOLUME=./config/seafile-mysql/db
SEAFILE_CADDY_VOLUME=./config/seafile-caddy

SEAFILE_MYSQL_DB_HOST=seafile-mysql
INIT_SEAFILE_MYSQL_ROOT_PASSWORD=1234
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=1234

TIME_ZONE=Europe/London

JWT_PRIVATE_KEY=8f4e39eaae88e2744e385618a4e44bfeead3c16637661e3eac2e400c62495478

SEAFILE_SERVER_HOSTNAME=seafile.domain.home
SEAFILE_SERVER_PROTOCOL=http

INIT_SEAFILE_ADMIN_EMAIL=me@domain.home
INIT_SEAFILE_ADMIN_PASSWORD=123


SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEADOC_VOLUME=./config/seadoc-data

ENABLE_SEADOC=true


NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest
NOTIFICATION_SERVER_VOLUME=./config/notification-data

NON_ROOT=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant