Thank you for your post, and welcome to the DHIS2 Community of Practice!
Please check who is the owner of the files/document directory? If it’s not the dhis user then this is the reason. You can use cd /opt/dhis2/files/ in your terminal and then ls -l to see the permission.
If you share your compose.yaml file, we can see if there are any obvious issues. It could be that, as @Gassim might be guiding you to, the owner of the mounted directory doesn’t match the Linux user running Tomcat inside of the container.
My first look as at these permissions. I see that the directory owner is root (user and user group) but it’s supposed to be the dhis user that is the owner.
Should I add a dhis user on the host? because there is no dhis user on the container. Changing permission inside the container is not allowed. Thank you
I have not tried to use Docker Compose yet; however, what I know from the main dhis2 installation guidelines is that we’re not supposed to use root user:
“You should not run the DHIS2 server as a privileged user such as root.” source
So what we do is we create a dhis user, and then:
Creating the configuration directory
Start by creating a suitable directory for the DHIS2 configuration files. This directory will also be used for apps, files and log files. An example directory could be:
DHIS2 will look for an environment variable called DHIS2_HOME to locate the DHIS2 configuration directory. This directory will be referred to as DHIS2_HOME in this installation guide. We will define the environment variable in a later step in the installation process.
If no environment variable DHIS2_HOME is found, the default configuration file location /opt/dhis2 is used.
The permissions are now given to the dhis user; however, in your instance the permissions are not given to root instead of 1000 so this is why I suspect it is causing the errors.
What guide are you following to install this setup? Thanks!
Thank you for the response. I will try to change the permission. Actually, this is working when using the default volume path of docker but to have a backup of the actual data I’m pointing it to an attached storage. Also, I want also to try using the filestore which for now supports only AWS S3. but on the configuration, there is no config for the endpoint of S3 or is it automatically handled by DHIS?
Great, you could compare permissions on the the default volume path and the new custom path you’re using for back up as I think they should be the same.
This is a different discussion point which is not exactly the same as the main post, so you’re welcome to create a new topic post but with further details and explaination please.
Thanks!