Issue with v13 CE install - Permission denied /etc/container_environment

Hi - I’m trying to retire my ancient Seafile 6.0.7 Windows server and do a clean install of Seafile 13 CE. I’m currently testing in an Ubuntu 25.04 VM to make sure I can do a tidy install on the new server. I don’t have a lot of Linux or Docker experience but can Google/ChatGPT my way through most things.

I’m guessing I’m running into a permissions issue but am at a loss on how to resolve it, as the error log is saying permission is denied for a folder that doesn’t actually exist on my machine. The error is below:

PermissionError: [Errno 13] Permission denied: ‘/etc/container_environment’
*** Killing all processes…
Traceback (most recent call last):
File “/sbin/my_init”, line 414, in
main(args)
File “/sbin/my_init”, line 330, in main
import_envvars(False, False)
File “/sbin/my_init”, line 90, in import_envvars
for envfile in listdir(“/etc/container_environment”):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/sbin/my_init”, line 74, in listdir
return sorted(os.listdir(path))
^^^^^^^^^^^^^^^^

I have RTFM’d the admin/install manual repeatedly trying to solve for this.

I’ve checked my /etc folder off root and there is a /containerd folder, but not a /container_environment folder. For reference, I have the container (and .env and .yml files) in /home/myusername/docker/seafile. The shared files are at /mnt/pollux/Seafile/seafile-data. I did go into seafile-server.yml and change NON_ROOT from false to true, and I’ve also added user: 1000:1000 to attempt to correct a rights issue. No luck with either or both.

Any thoughts? I did have v11 running and I guess I can just revert back to that (assuming I can get it running again!), but as this is a new install, would like to start with the most current if possible. I haven’t attempted a server upgrade in Docker and think that could be interesting given my limited skills, so newer is better!

Any help would be greatly appreciated.

Thanks…

Jason

Started with a clean install of v13 CE and was able to get it running…as long as I don’t deviate from the installation manual at all. That said, when I’m done with testing and ready to install on the new server, I do need to have the seafile-data folder resident on a persistent SMB share on the Linux box, versus being on the local drive. If anyone can help with the “dummies guide” to accomplishing that - changes to .env and/or .yml - that would be great. I thought I had figured it out, but given the prior errors and general carnage of the earlier install…perhaps not.

Thanks!

Jason

You should just be able to set the path in the .env to put the data where ever you want it, as long as that path has the right ownership & permissions to make sure it is writable by the container. I’ve never used SMB for docker storage, but as long as it is configured correctly I would expect it to work.

My best guess for why you are having trouble putting the volume somewhere else is that maybe you are using docker that came from the Ubuntu package (from canonical). Canonical decided to ship docker as a snap package even though that breaks things. The docker snap package is only allowed to read and write certain areas in the host filesystem. which likely doesn’t include wherever that SMB share is mounted.

Docker provides some documentation on how to remove the snap and install docker the way they think it should be installed it to get around this limitation, but it might be easier to just replace Ubuntu with something that doesn’t use snaps, like Debian.

Thank you for your help. I had actually done a clean Docker install as I heard there were some issues with Snap. The .env changes would seem to work but couldn’t get everything to launch correctly. I did get it resolved (or, at least fingers crossed I did) and it was two issues. First, I had an old link for the shared SMB target in my /etc/fstab and was pointing to a different share. Once that was corrected, I still had issues due to permissions on the SMB target folder as it was not owned by root. I did a chmod to have root own that folder and now it seems to be working well. I’m going to keep testing, including tearing everything down and trying to reinstall to verify, but hoping that solves for it!

Best,

Jason

But what is the right ownership and permission ?

I have struggeled with the same for 2 days - I have a NFS share on TrueNas

Stupidly, I didn’t note it down, but I believe the command I used to change ownership of the folder was:

sudo chown -R root:root /path/to/smb/folder

One other item - I added NON_ROOT to the .env file as referenced here:

Run Seafile as non root user inside docker - Seafile Admin Manual

I don’t think that fixed it though….I believe the SMB share fix was to chown the folder with root. If I get a chance to tear it down again and reinstall this week, I can confirm.

Best of luck!

Jason