I have dolibarr 22.0.3 installed with docker on my machine. I am having some problems with the MySQL mysqldump backup that, when trying to make a new backup sends the message: “ERROR: unable to write in the directory”.
I am not understanding which directory is it referring to and why it can’t write.
When trying to backup from PHP I get sent to a page /admin/tools/export.php that gives a 500 error code.
Dolibarr is trying to create the backup in the …documents/admin/backup folder.
If that folder isn’t set with write permissions for the web user it will give the error.
okay, so in docker the users inside the docker container are different than the users outside the docker container.
If you mount a local disk from outside docker into the docker on that path inside the docker container, then you are mixing the users and permissions. This is possible, the easiest way is to make it world writeable for everyone - but that is also a dangerous security risk.
You can most likely map the users from outside docker to inside the docker container, but you need to specify that.
If you use docker volumes, then all this should not be necessary.
Take a look at the files in that directory, and the directory itself. Which user/user id are the owner and group of those files?
that would be the uid mapping between inside and outside Docker. The uid is a number and a number will be a number no matter where, but it may or may not correlate to the same username.
if it is just a number, then you could create a user outside docker with that user id and then you have a name, not just a number.