Error:the user running the script ("root") is not the owner of "/shared/seafile/seafile-data" folder, you should use the user "UNKNOWN" to run the script

I am trying to run Seafile in Portainer which is installed in OMV running on a RPi4. Seafile installs fine using Stacks but if I restart the Docker container I get this.
Error: the user running the script (“root”) is not the owner of “/shared/seafile/seafile-data” folder, you should use the user “UNKNOWN” to run the script.
I have tried creating the Volume from portainer GUI and also from CLI docker volume create seafile but same results. Here is my Docker Compose file.
- seafile-net

memcached:
image: memcached:1.5.6
container_name: seafile-memcached
entrypoint: memcached -m 256
restart: always
networks:
- seafile-net

seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
restart: always
ports:
- 8290:80 # you can change the left side to any open port
volumes:
- seafile:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=xxxxxx
- TIME_ZONE=Pacific/Auckland
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:
volumes:
seafile:
external: true

1 Like

Hi, I’m getting the same error (using docker-compose)

seafile | Error: the user running the script (“root”) is not the owner of “/shared/seafile/seafile-data” folder, you should use the user “UNKNOWN” to run the script.

The error likely started when I ran a script on my filesystem to repair file permissions/ownership for Unraid OS. I had my seafile instance offline for a while and wasn’t monitoring it, when I started it back up it threw that error.

Any idea how to fix this? My seafile server was running fine for a couple years before this problem. I’ve actually migrated to onedrive so it’s not the end of the world, but still I’d like to fix it…

version: '2.0'
services:
  db:
    image: mariadb:10.5
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=***  # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /mnt/user/seafile7/opt/seafile-mysql/db:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
      - /mnt/user/mybackups/seafile-server:/mybackup # mount for backup destination
    networks:
      - seafile-net
    restart: always

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net
    restart: always

  elasticsearch:
    image: elasticsearch:7.16.2
    container_name: seafile-elasticsearch
    environment:
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 2g
    volumes:
      - /mnt/user/seafile7/opt/seafile-elasticsearch/data:/usr/share/elasticsearch/data  # Requested, specifies the path to Elasticsearch data persistent store.
    networks:
      - seafile-net
    restart: always
          
  seafile:
    image: docker.seafile.top/seafileltd/seafile-pro-mc:9.0.4
    container_name: seafile
    ports:
      - "8000:80"
#     - "443:443"  # If https is enabled, cancel the comment.
      - "8583:8082"  # seafhttp 8082
      - "8584:8080"  # seafdav 8080
    volumes:
      - /mnt/user/seafile7/opt/seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=***  # Requested, the value shuold be root's password of MySQL service.
      - TIME_ZONE=America/Los_Angeles # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL=*** # Specifies Seafile admin user, default is 'me@example.com'
      - SEAFILE_ADMIN_PASSWORD=***     # Specifies Seafile admin password, default is 'asecret'
      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not
      - SEAFILE_SERVER_HOSTNAME=*** # Specifies your host name if https is enabled
    depends_on:
      - db
      - memcached
      - elasticsearch
    networks:
      - seafile-net
    restart: always

networks:
  seafile-net:

My quick and dirty fix was to login to the container and change the ownership of the

/shared/ directory and make root the owner.

chown root:root --recursive /shared

I’m sure that isn’t the right way to fix it, but it got me out of the current pickle

3 Likes

hay hi
even i facesd the same issues
this issue is when you use external derive or hard disk path for the volumes it cannot transfer the owner ship of the seafile-mysql for /var/lib/ so at your docker.yml file for the first volumes :
insted of /mnt/user(external hardware path ) just give a system path as fallowing or any path in system itself

volumes : 
-  /opt/seafile-mysql/db:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.

second volume can be any of the external drive path

save my ass, thank u

How does one login to the container to change the ownership? I am about as stuck as stuck gets. Same issue, I’m using unraid.

In my case, the problem was in the CIFS volume definition.

My seafile shared folder is in a NAS (TrueNAS, to be more specific). The filesystem where the seafile folder resides, is owned by “plex”. After changing the uid/gid of the mounting parameters from 1001 (plex id) to 0, the issue was fixed:

volumes:
  shared:
    driver: local
    driver_opts:
      type: cifs
      o: username=foo,password=bar,rw,vers=3,domain=lan,uid=0,gid=0
      device: "//192.168.0.2/seafile"

Hello! I just had the same experience and I was wandering where you could locate this template you have displayed here for your Seafile docker settings. I would like to edit this to solve the issue as kiran1234 mentions below by changing it a system path instead of /mnt/user…

thanks!