Enabling "Non-root = true" --> Error dependency seafile failed to start

I had a seafile docker installation that worked great.

I wanted to use it as non root.

I followed the instructions:

Now I get always the error message as below, when trying to docker compose up-d

:check_mark: Network seafile-net Created
:check_mark: Container seafile-caddy Started
:check_mark: Container seafile-redis Started
:check_mark: Container seafile-mysql Healthy
:check_mark: Container seadoc Started
✘ Container seafile Error dependency seafile failed to start
✘ Container notification-server not started: condition “service_healthy” of service “seafile” not met dependency failed to start: container seafile is unhealthy

What happened?

Removing the non-rott = true line from .env doesn;t help solving the error.

It seems that I just needed to wait for approximately 20-30 minutes.
Then Seahub started at some stage and the installation worked.

It seems this happens every time when I start seafile docker again. So I am not sure the non-root option is very interesting for me.
It’s just not quick enough

With non-root = true, the script that starts the seafile software inside the container does some extra steps. It looks like:

# non-noot 
if [[ $NON_ROOT == "true" ]] ;then
...
    # chown
    chown seafile:seafile /opt/seafile/
    chown -R seafile:seafile /opt/seafile/$SEAFILE_SERVER-$SEAFILE_VERSION/

So on every start it does a chown on all of your seafile server’s data. I modified that on mine to check the owner of /opt/seafile/seafile-server-latest/seafile.sh, and only do the chown if it isn’t already owned by seafile. But that didn’t really work well since that change gets reverted when the container gets rebuilt (like by updating to a new version). I need to find time to finish working on that,

I did the trouble shooting with Claude and it advised the the same thing.

If one has to restart quickly a server with a large database every now and then, this option is a bit slow.

Also it could be good to improve the error message, so users know that the seafile script is still running in the background ond one just has to wait for it to finish and that it can take 20-30 minute - or more.

The work to reduce non-root Docker startup time is complete and is associated with version 13.0.31. It moves permission changes for files inside the image to build time. Release availability and verification have not yet been confirmed.

Thank you @daniel.pan

Would you recommend to run seafile in non-root mode?
Do you think it’s better / safer?

I wondered if it would be wirth while swapping in any case.

Yes, running Seafile as a non-root user is generally good security practice: it limits the privileges available to the application if it is compromised, though it does not eliminate security risks.

For history reasons, we need to keep the root mode as default option.

Whether switching is worthwhile depends on your priorities. In your setup, the reported 20–30 minute startup delay is a significant trade-off if you need quick restarts. I would consider non-root mode if that delay is acceptable, but it is reasonable to wait if availability is more important.