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

Permission denied #10

Open
qingyuan0o0 opened this issue Aug 18, 2023 · 8 comments
Open

Permission denied #10

qingyuan0o0 opened this issue Aug 18, 2023 · 8 comments

Comments

@qingyuan0o0
Copy link

`docker run -it --name sdw --network host -v $(pwd)/models:/app/stable-diffusion-webui/models -v $(pwd)/outputs:/app/stable-diffusion-webui/outputs --rm siutin/stable-diffusion-webui-docker:latest-cpu bash webui.sh --skip-torch-cuda-test --use-cpu all --share

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on app user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
Python 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Launching Web UI with arguments: --skip-torch-cuda-test --use-cpu all --share
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Traceback (most recent call last):
File "/app/stable-diffusion-webui/launch.py", line 39, in
main()
File "/app/stable-diffusion-webui/launch.py", line 35, in main
start()
File "/app/stable-diffusion-webui/modules/launch_utils.py", line 390, in start
import webui
File "/app/stable-diffusion-webui/webui.py", line 54, in
from modules.call_queue import wrap_gradio_gpu_call, wrap_queued_call, queue_lock # noqa: F401
File "/app/stable-diffusion-webui/modules/call_queue.py", line 6, in
from modules import shared, progress, errors
File "/app/stable-diffusion-webui/modules/shared.py", line 83, in
os.makedirs(cmd_opts.hypernetwork_dir, exist_ok=True)
File "/app/miniconda3/lib/python3.10/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/app/stable-diffusion-webui/models/hypernetworks'
`

@Josh-XT
Copy link

Josh-XT commented Aug 19, 2023

I am getting the same thing currently using docker compose:

services:
  stable-diffusion:
    image: siutin/stable-diffusion-webui-docker:latest-cuda
    command: bash webui.sh --share
    ports:
      - 7861:7860
    volumes:
      - ./models:/app/stable-diffusion-webui/models
      - ./outputs:/app/stable-diffusion-webui/outputs
    deploy:
      resources:
        reservations:
          devices:
          - driver: nvidia
            count: all
            capabilities: [ gpu ]

@siutin
Copy link
Owner

siutin commented Aug 19, 2023

This could be resolved with the following commands:

mkdir -p /MY-DATA-DIR && cd /MY-DATA-DIR
mkdir models outputs
sudo chown 10000:$UID -R models outputs
sudo chmod 775 -R models outputs

@Josh-XT
Copy link

Josh-XT commented Aug 19, 2023

This could be resolved with the following commands:

mkdir -p /MY-DATA-DIR && cd /MY-DATA-DIR
mkdir models outputs
sudo chown 10000:$UID -R models outputs
sudo chmod 775 -R models outputs

Could that be added to the dockerfile?

@qingyuan0o0
Copy link
Author

Excellent, I tested successfully. Thank you very much!

@mvstrawn
Copy link

In case this comes up for you,
The solution proposed here (and re-stated in the documentation) didn't work for me on Arch Linux. I'm not sure why, however, what did work was:

podman unshare chown -R 10000:10000 models outputs

This is when running the container in rootless mode. Just wanted to comment this here in case anybody else has this problem.

@everdt-MaShuai
Copy link

My guess is that the source code has the wrong path.

Wrong path '/app/stable-diffusion-webui/models/hypernetworks'

Correct path '/app/stable-diffusion-webui/modules/hypernetworks'

@computercam
Copy link

computercam commented Jun 21, 2024

Please consider making the UID and GID configurable with environment variables. This essentially forces the end user to have to create a specific user account with that exact UID/GID if they want to interact with those files outside of a1111. It also prevents the user from being able to to share SD files between different interfaces if other docker instances have a different user IDs.

Another option would be to use the default ID of 1000 instead of 10000.

@shandshellin
Copy link

agreed PGID and PUID at 1000, configurable in env varibles. The thought of doing this manually on each node in my swarm in nauseating.

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

No branches or pull requests

7 participants