Skip to content
New issue

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

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

Already on GitHub? # to your account

[Bug]: Setting --data-dir to a path outside of the Gradio working directory breaks extensions. Commit: ea9bd9fc #7684

Closed
1 task done
d3x-at opened this issue Feb 9, 2023 · 5 comments
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance gradio Items related specifically to Gradio (user interface library). May or may not be upstream issues.

Comments

@d3x-at
Copy link

d3x-at commented Feb 9, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

After installing an extension (in my case, a1111-sd-webui-tagcomplete), it fails to activate.

Instead, the following error is returned:

Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
  File "/home/stable-diffusion/stable-diffusion-webui/modules/scripts.py", line 229, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "/home/stable-diffusion/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/data/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 193, in <module>
    write_tag_base_path()
  File "/data/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 168, in write_tag_base_path
    f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix())
  File "/usr/local/lib/python3.10/pathlib.py", line 818, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/data/extensions/a1111-sd-webui-tagcomplete/tags' is not in the subpath of '/home/stable-diffusion/stable-diffusion-webui' OR one path is relative and the other is absolute.
Closing server running on port: 80800 [00:00<?, ?it/s]
Restarting UI...

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/_result.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.

Steps to reproduce the problem

  1. Run webui.sh with a data dir outside of the stable-diffusion-webui (i.e. webui.sh --data-dir /data)
  2. Install an Extension (i.e.: a1111-sd-webui-tagcomplete)
  3. Press the "Apply and restart UI" Button.

What should have happened?

Extension should have activated normally.

Commit where the problem happens

ea9bd9f

What platforms do you use to access the UI ?

Linux, Other/Cloud

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

command line: bash webui.sh --listen --enable-insecure-extension-access --data-dir /data --port 8080 --skip-torch-cuda-test --precision full --no-half --use-cpu all

webui-user.sh changes:
venv_dir="/data/venv"
export TORCH_COMMAND="pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2"

List of extensions

a1111-sd-webui-tagcomplete

Console logs

Closing server running on port: 8080
Restarting UI...

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

################################################################
Running on stable-diffusion user
################################################################

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

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

################################################################
Launching launch.py...
################################################################
/data/venv/lib/python3.10/site-packages/torch/cuda/__init__.py:88: UserWarning: HIP initialization: Unexpected error from hipGetDeviceCount(). Did you run some cuda functions before calling NumHipDevices() that might have already set an error? Error 101: hipErrorInvalidDevice (Triggered internally at ../c10/hip/HIPFunctions.cpp:110.)
  return torch._C._cuda_getDeviceCount() > 0
Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
  File "/home/stable-diffusion/stable-diffusion-webui/modules/scripts.py", line 229, in load_scripts
    script_module = script_loading.load_module(scriptfile.path)
  File "/home/stable-diffusion/stable-diffusion-webui/modules/script_loading.py", line 11, in load_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/data/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 193, in <module>
    write_tag_base_path()
  File "/data/extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py", line 168, in write_tag_base_path
    f.write(TAGS_PATH.relative_to(FILE_DIR).as_posix())
  File "/usr/local/lib/python3.10/pathlib.py", line 818, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/data/extensions/a1111-sd-webui-tagcomplete/tags' is not in the subpath of '/home/stable-diffusion/stable-diffusion-webui' OR one path is relative and the other is absolute.

Python 3.10.9 (main, Feb  4 2023, 11:55:23) [GCC 10.2.1 20210110]
Commit hash: ea9bd9fc7409109adcd61b897abc2c8881161256
Installing requirements for Web UI
Launching Web UI with arguments: --listen --enable-insecure-extension-access --data-dir /data --port 8080 --precision full --no-half --use-cpu all
Warning: caught exception 'Unexpected error from hipGetDeviceCount(). Did you run some cuda functions before calling NumHipDevices() that might have already set an error? Error 101: hipErrorInvalidDevice', memory monitor disabled
No module 'xformers'. Proceeding without it.
Loading weights [cc6cb27103] from /data/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
Creating model from config: /home/stable-diffusion/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0): 
Model loaded in 10.2s (load weights from disk: 6.7s, load config: 0.2s, create model: 1.7s, apply weights to model: 1.6s).
Running on local URL:  http://0.0.0.0:8080

To create a public link, set `share=True` in `launch()`.
Closing server running on port: 8080
Restarting UI...
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/_result.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/_textAreas.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/_utils.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/tagAutocomplete.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/_textAreas.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/_utils.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/data/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/data/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/fastapi/applications.py", line 271, in __call__
    await super().__call__(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/applications.py", line 125, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/data/venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/data/venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
    await route.handle(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/data/venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/data/venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/data/venv/lib/python3.10/site-packages/gradio/routes.py", line 286, in file
    raise ValueError(
ValueError: File cannot be fetched: /data/extensions/a1111-sd-webui-tagcomplete/javascript/tagAutocomplete.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app.

Additional information

Ideally, i would want extensions to be stored outside the stable-diffusion-webui to survive container rebuilds.
This might not be possible though, as Gradio seems to enforce its directory requirements.

Also, possibly, not everybody would want to put their extensions in the same location as other user data.

An alternative would be, to decouple the directory given with --data-dir and the directory where the extensions are loaded from.

@d3x-at d3x-at added the bug-report Report of a bug, yet to be confirmed label Feb 9, 2023
@astew
Copy link

astew commented Feb 11, 2023

Same issue on Windows 10, just as described.

I'll add that I tried working around this by creating a {symbolic link | hard link | directory junction} within stable-diffusion-webui/ to a path outside stable-diffusion-webui/ and it still did not work.

@lookdczar
Copy link

same to me, lots of extensions have js file will get this error

@StreakingMan
Copy link

same +1, I want to put my models/extensions in my NAS, but extension (like controlnet) not work 😭

@catboxanon
Copy link
Collaborator

Add the folder to the --gradio-allowed-path cmdline arg. In your case it'd probably look something like this:

--gradio-allowed-path /data/extensions

@catboxanon catboxanon added asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance gradio Items related specifically to Gradio (user interface library). May or may not be upstream issues. and removed bug-report Report of a bug, yet to be confirmed labels Aug 11, 2023
@w-e-w
Copy link
Collaborator

w-e-w commented Nov 1, 2023

fix PR was merged #12603

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance gradio Items related specifically to Gradio (user interface library). May or may not be upstream issues.
Projects
None yet
Development

No branches or pull requests

6 participants