Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The directory specified for uploaded files does not exist or is not writable. #343

Open
mehran-tarif opened this issue Oct 14, 2023 · 7 comments
Labels
needMoreInfo We need more info to decide.

Comments

@mehran-tarif
Copy link

mehran-tarif commented Oct 14, 2023

I am encountering an issue while trying to install OJS (Open Journal Systems) using Docker. I have followed the installation instructions and made no changes to the .env file (except PROJECT_DOMAIN=localhost). However, I am getting an error message that says, "The directory specified for uploaded files does not exist or is not writable."

I have reviewed the docker-compose.yml file and noticed that there is a volume named volumes/private bind to /var/www/files which exists in volumes by default. Despite this, I am still experiencing this error.

I would appreciate any assistance or guidance on how to resolve this issue and successfully install OJS using Docker. Thank you!

Screenshot 2023-10-14 at 16-48-50 OJS Installation

@marcbria
Copy link
Collaborator

Sorry for the delay in my answer. This is a side project and I don't have much time.

Did you manage to make it work?

This usually happens when you don't have the right permissions in the volume folder in host.
I recommend check the user and group of your apache in you container (usually is 100) and change the permissions properly.

Normally something like this will work:
$ chown 100:100 volumes/private * -R

If this fails, as a temporary solution till you discover how to set the permisions to the apache user, you can try with a "chmod 666 volumes/private" to make the folder pubically accessible.

Cheers,
m.

@MartinPaulEve
Copy link

Just to say that I had this exact problem and had to exec into the container and set ownership of apache:apache on several dirs that were set only to root:root.

@marcbria
Copy link
Collaborator

Thanks for your freeback @MartinPaulEve
Just to be sure: With the propper permissions all works fine to you, isn't it?

If yes, I will close it as is not an issue, it's the way docker works and probably highlight the chown 100:101 volumes/private in README.

@MartinPaulEve
Copy link

Hmm, I cannot confirm that setting 100:101 on volumes/private fixes this as I haven't looked.

Indeed, my fix was to change permissions inside the container, which seemed to work. If the external host volume prohibited writing, I assume this would not have worked. So I am unsure that the fix is the external change.

@marcbria
Copy link
Collaborator

marcbria commented Feb 26, 2024

If all works as expected, there is no difference between changing ownership inside the container (with apache:apache) or outside it (with 101:101)... but I usually suggest the second because login inside the container requires more explanations/knowledge.

Do you mind to confirm your private folder is with user 100 and group 101 from outside the container running:

$ ls -n volumes/private

Thanks for your help Martin.

@MartinPaulEve
Copy link

`
[martin@v2 testJournal] (main)$ ls -n volumes/private
Permissions Size User Group Date Modified Name
drwxr-xr-x - 100099 100100 23 Feb 17:56 journals
drwxr-xr-x - 100099 100100 26 Feb 00:00 scheduledTaskLogs
drwxr-xr-x - 100099 100100 23 Feb 17:43 site
drwxr-xr-x - 100099 100100 23 Feb 17:58 usageStats

`

@marcbria
Copy link
Collaborator

Wired. In my debian is 100:101. :-(

Let's keep it open just in case somebody else can offer us more information... and modify the README to ensure permisions are set even in the TL;DR; verison.

@marcbria marcbria added the needMoreInfo We need more info to decide. label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needMoreInfo We need more info to decide.
Projects
None yet
Development

No branches or pull requests

3 participants