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

Can't create directory /var/www/app/storage/app #330

Closed
perteraul opened this issue Apr 21, 2021 · 9 comments
Closed

Can't create directory /var/www/app/storage/app #330

perteraul opened this issue Apr 21, 2021 · 9 comments
Labels

Comments

@perteraul
Copy link

After editing the env, docker-compose.yml and the hosts file, I keep getting this error on docker files_app_1:

cp: can't create directory '/var/www/app/storage/app': Operation not permitted

I did follow the instructions and set

chmod 755 docker/app/public
sudo chown -R 1500:1500 docker/app

Any ideas?

@turbo124
Copy link
Member

@perteraul as the error states, it is a permissions error, i think if the folder isn't chown'd properly before the container is brought up - the container is never going to be in the right state.

@dIELERx
Copy link

dIELERx commented Apr 25, 2021

I am running into the same issue.

I followed the instructions in this github repo and I am not able to get invoiceninja up and running:
After cloning the repo, I have generated the APP_Key and then added it to the env file as well as the URL.
Afterwards I changed the permissions as described in manual.

chmod 755 docker/app/public
chown -R 1500:1500 docker/app

But it doesn't matter what I do, its just not starting. I removed the repo a few times and started over and over...

app_1     | cp: can't create directory '/var/www/app/storage/app': Permission denied
app_1     | cp: can't create directory '/var/www/app/storage/app': Permission denied
app_1     | cp: can't create directory '/var/www/app/storage/app': Permission denied
app_1     | cp: can't create directory '/var/www/app/storage/app': Permission denied
app_1     | cp: can't create directory '/var/www/app/storage/app': Permission denied
app_1     | cp: can't create directory '/var/www/app/storage/app': Permission denied
dockerfiles_app_1 exited with code 1
Exception in thread Thread-5:
Traceback (most recent call last):
  File "site-packages/docker/api/client.py", line 261, in _raise_for_status
  File "site-packages/requests/models.py", line 940, in raise_for_status
requests.exceptions.HTTPError: 409 Client Error: Conflict for url: http+docker://localhost/v1.38/containers/de6a9ba22a778e0f228db81c631813e3651f9d3d7a911968a3f63e3220900163/attach?logs=0&stdout=1&stderr=1&stream=1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "threading.py", line 916, in _bootstrap_inner
  File "threading.py", line 864, in run
  File "compose/cli/log_printer.py", line 233, in watch_events
  File "compose/container.py", line 215, in attach_log_stream
  File "compose/container.py", line 307, in attach
  File "site-packages/docker/utils/decorators.py", line 19, in wrapped
  File "site-packages/docker/api/container.py", line 61, in attach
  File "site-packages/docker/api/client.py", line 400, in _read_from_socket
  File "site-packages/docker/api/client.py", line 311, in _get_raw_response_socket
  File "site-packages/docker/api/client.py", line 263, in _raise_for_status
  File "site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
docker.errors.APIError: 409 Client Error: Conflict ("b'container de6a9ba22a778e0f228db81c631813e3651f9d3d7a911968a3f63e3220900163 is restarting, wait until the container is running'")

@perteraul
Copy link
Author

@dIELERx I solved my issues by opening Transmit and applying 755 to the docker folder (also checked to apply to all of the enclosing folders).

Before I did that, I tried manually creating the folders and thought it was weird because it would ask me for my password each time. After I change the permissions from Transmit, it stopped asking me for the password and the docker installation worked.

I knew I should've documented this... sorry! 😅

@dIELERx
Copy link

dIELERx commented Apr 25, 2021

@perteraul thanks for the quick answer ;). Which docker folder do you mean? The one who is included in the repository?
Even applying 777 permissions to the included docker folder does not change anything.. I always get the same error.

@kaeferfreund
Copy link

kaeferfreund commented May 14, 2021

I am having the same issue - folder permissions are correct, 3x checked with ls -l for all files and folders! Minimal changes to the docker compose file.

EDIT:
Error Message from NGINX:
403 Forbidden nginx/1.19.10

Error from NGINX:
*1 directory index of "/var/www/app/public/" is forbidden,

@kevintrannz
Copy link

I have same issue:
app_1 | cp: can't create directory '/var/www/app/storage/app': Permission denied

Does anyone have a workaround on this issue please? Thank you.

@lwj5
Copy link
Member

lwj5 commented May 18, 2021

Please run the commands outlined here
#305 (comment)

And post the output in this thread

@Rydestudio
Copy link

Rydestudio commented Nov 5, 2021

I am having this same issue. None of the solutions here worked.

here is what I get running the the commands from the above comment.

[root@97ca286bdfe1:/# id
uid=0(root) gid=0(root) groups=0(root)
root@97ca286bdfe1:/# cd /var/www
root@97ca286bdfe1:/var/www# ls -l
total 4
drwxr-xr-x 3 root root 4096 Nov 5 16:34 app
root@97ca286bdfe1:/var/www# cd app
root@97ca286bdfe1:/var/www/app# ls -l
total 0
drwxr-xr-x 3 root root 96 Nov 5 16:24 public
root@97ca286bdfe1:/var/www/app#
root@97ca286bdfe1:/var/www/app# cd public
root@97ca286bdfe1:/var/www/app/public# ls -l
total 0

@Rydestudio
Copy link

The solution for me was not to run the command sudo chown -R 1500:1500 docker/app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants