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

[Bug]: Gradio issue, "Value Error: File cannot be fetched: <... extensions/...the file...>" #7028

Closed
1 task done
valconius opened this issue Jan 21, 2023 · 12 comments · Fixed by #9865
Closed
1 task done
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@valconius
Copy link

valconius commented Jan 21, 2023

Is there an existing issue for this?

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

What happened?

The following error is logged:

ValueError: File cannot be fetched: /home/valconius/Library-Remote/C30 Documents/C3080 Stable Diffusion/Interfaces/nsd--atagen/nix-stable-diffusion--no-nixlib-in-flake/stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/javascript/tagger.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app

However, using the extension in question, "stable diffusion webui wd14 tagger", works just fine. Not all extensions have this issue, but many do.

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

My extensions and many other files are symlinked to locations outside the webui file tree. This issue did not occur with a git pull from a couple of days ago but now occurs.

Commit where the problem happens

216f67e

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

pytho launch.py --api

Additional information, context and logs

No response

@valconius valconius added the bug-report Report of a bug, yet to be confirmed label Jan 21, 2023
@mezotaken
Copy link
Collaborator

mezotaken commented Jan 21, 2023

Same problem? #6939 Scenarios are a bit different, i'll leave this one open.

@mezotaken mezotaken added duplicate and removed bug-report Report of a bug, yet to be confirmed labels Jan 21, 2023
@mezotaken mezotaken closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2023
@mezotaken mezotaken added bug-report Report of a bug, yet to be confirmed and removed duplicate labels Jan 21, 2023
@mezotaken mezotaken reopened this Jan 21, 2023
@martinobettucci
Copy link

Confirmed, but the ISSUE opener did focus on the wrong commit.

The REAL commit where the problem started is 50059ea#commitcomment-97757826

You can check it by reverting the webui to the previous commit by git reset --hard 17af0fb95574068a1d5032ae96879dab145e173a then the problem vanish.
Now go to the commit git reset --hard 50059ea661b63967b217e687819cf7a9081e4a0c and the BUG is there.

The BUG is still there as of 97ba01a (HEAD at the time of writing)

@AUTOMATIC1111

@jjtolton
Copy link
Contributor

Is there a loss of functionality or just an error message?

@jjtolton
Copy link
Contributor

Is there an existing issue for this?

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

What happened?

The following error is logged:

ValueError: File cannot be fetched: /home/valconius/Library-Remote/C30 Documents/C3080 Stable Diffusion/Interfaces/nsd--atagen/nix-stable-diffusion--no-nixlib-in-flake/stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/javascript/tagger.js. All files must contained within the Gradio python app working directory, or be a temp file created by the Gradio python app

However, using the extension in question, "stable diffusion webui wd14 tagger", works just fine. Not all extensions have this issue, but many do.

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

My extensions and many other files are symlinked to locations outside the webui file tree. This issue did not occur with a git pull from a couple of days ago but now occurs.

Commit where the problem happens

216f67e

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

pytho launch.py --api

Additional information, context and logs

No response

Sorry for the inconvenience. Currently the documentation requires copying them into the extensions directory, but I'm checking with the author on what should be supported: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions
Try copying them directly and see if that doesn't fix the problem.

@martinobettucci
Copy link

Is there a loss of functionality or just an error message?

Yes, total loss of functionality: none of the plugins works anymore.
By the way, I'l running stable diffusion in a dockerized environment with mounted individual folders => if this is the problem, please understand it never have been one prior ths commit I referred earlier.

@jjtolton
Copy link
Contributor

@martinobettucci Gradio has been making changes around the way it deals with symlinks: gradio-app/gradio#3037 I'm keeping an eye on it. In the meantime, in your Dockerfile, you can always mount the extensions to a separate file and then cp -r to the extensions directory, that should be a workaround.

@martinobettucci
Copy link

I found a workaround @jjtolton, just mount the '/extension' folder as a volume in docker instead of symlinking it to you external SDD

@mriamnobody
Copy link

@valconius Which version of python you are using? I have python 3.10.7 and had no issues related to gradio.

serg4kostiuk pushed a commit to talkable/stable-diffusion-webui that referenced this issue Mar 22, 2023
This may be helpful for
AUTOMATIC1111#7028,
because we won't change working directory to the repo now, instead,
we will use any working directory. If we set working directory to
a path contains repo and the custom --data-dir, the problem in this
issue should be solved.

Howewer, this may be treated as an incompatible change if some code
assume the working directory is always the repo.

Also, there may be another solution that always let --data-dir be the
subdirectory of the repo, but personally I think this may not be what
we actually need.

As this issue mainly influent on Docker and I am not familiar with
.bat files, updating webui.bat is skipped.

webui.sh: source env from repo instead $PWD
serg4kostiuk pushed a commit to talkable/stable-diffusion-webui that referenced this issue Mar 22, 2023
This may be helpful for
AUTOMATIC1111#7028,
because we won't change working directory to the repo now, instead,
we will use any working directory. If we set working directory to
a path contains repo and the custom --data-dir, the problem in this
issue should be solved.

Howewer, this may be treated as an incompatible change if some code
assume the working directory is always the repo.

Also, there may be another solution that always let --data-dir be the
subdirectory of the repo, but personally I think this may not be what
we actually need.

As this issue mainly influent on Docker and I am not familiar with
.bat files, updating webui.bat is skipped.

webui.sh: source env from repo instead $PWD
@Renari
Copy link

Renari commented Apr 12, 2023

I was able to get around this via:

sed -i 's/in_app_dir = .*/in_app_dir = True/g' /usr/local/lib/python3.10/dist-packages/gradio/routes.py

Not sure what other implications this has.

This was referenced Apr 25, 2023
@Gh20221205
Copy link

I was able to get around this via:

sed -i 's/in_app_dir = .*/in_app_dir = True/g' /usr/local/lib/python3.10/dist-packages/gradio/routes.py

Not sure what other implications this has.

Can you tell me how and where to execute that command, in windows? linux? Using which software?

@jjtolton
Copy link
Contributor

I don't think this should still be an issue in latest versions. Are you still experiencing issues?

@Gh20221205
Copy link

I don't think this should still be an issue in latest versions. Are you still experiencing issues?

You are right, I just need to upgrade my webui to the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants