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]: FileNotFoundError: [Errno 2] No such file or directory: 'T:\systemp\sd_temp_files\tmpe4svot1d' #86

Closed
1 task done
Woisek opened this issue Apr 10, 2023 · 10 comments

Comments

@Woisek
Copy link

Woisek commented Apr 10, 2023

Is there an existing issue for this?

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

What happened?

Unfortunately, this bug still exists in this fork.
A defined temp folder in the WebUI settings will not be created if it's not existent and causes errors (even up to crashes) for some actions and extensions that rely on this folder.
Please fix this ASAP, because it's really annoying for almost half a year now.

Steps to reproduce the problem

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

What should have happened?

The temp folder specified in the settings should be created if not existent.

Commit where the problem happens

AUTOMATIC1111/stable-diffusion-webui@ffc54d0

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--disable-sdp-attention --xformers --api --administrator --opt-split-attention --theme=dark

List of extensions

extensions_automatic

Console logs

FileNotFoundError: [Errno 2] No such file or directory: 'T:\systemp\sd_temp_files\tmpe4svot1d'

Additional information

No response

@vladmandic
Copy link
Owner

See #92. Work is in progress, in the meantime closing this as duplicate.

@Woisek
Copy link
Author

Woisek commented Apr 11, 2023

Allright, thanks for this info!

@Woisek
Copy link
Author

Woisek commented Apr 25, 2023

Just again had this issue ... 😔

100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:03<00:00, 9.20it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:03<00:00, 9.23it/s]
Traceback (most recent call last):
File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
output = await app.get_blocks().process_api(
File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\blocks.py", line 1078, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\blocks.py", line 1012, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "I:\Super SD 2.0\automatic\venv\lib\site-packages\gradio\components.py", line 3954, in postprocess
file = processing_utils.save_pil_to_file(img)
File "I:\Super SD 2.0\automatic\modules\ui_tempdir.py", line 42, in save_pil_to_file
file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
File "F:\Programme\Python310\lib\tempfile.py", line 559, in NamedTemporaryFile
file = _io.open(dir, mode, buffering=buffering,
File "F:\Programme\Python310\lib\tempfile.py", line 556, in opener
fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "F:\Programme\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'T:\systemp\sd-temp-files\tmpwrwa7i3m.png'

14:43:45-814677 INFO Version: dcd6d5b Tue Apr 25 08:04:43 2023 -0400

@vladmandic
Copy link
Owner

did you restart server after changing temp_dir?
if folder does not exist, it should provide output on console:

Creating folder: /tmp/sd/images

@Woisek
Copy link
Author

Woisek commented Apr 25, 2023

I didn't changed the temp dir. it's always T:\systemp\sd-temp-files\ in the settings.

if folder does not exist, it should provide output on console:

At what time does this occur/is this checked? Because ... obviously when needed, it does not create anything ... 😔
Edit: OK, I see it will be created at startup. Aren't there anymore checks while running?

@vladmandic
Copy link
Owner

check/create-if-missing happens as soon as launcher is complete and it starts webui.
basically first line after Server arguments and before Available models
no, there are no checks while running.

@Woisek
Copy link
Author

Woisek commented Apr 25, 2023

So, if a script/extension needs the temp folder and the folder was flushed previously, it will not be re-created ... ?

@vladmandic
Copy link
Owner

it will be recreated during startup. how can a folder be flushed during runtime? if you delete it manually, then yes, thats a problem.

@Woisek
Copy link
Author

Woisek commented Apr 25, 2023

how can a folder be flushed during runtime?

As I said a while ago, this is the system temp folder. And since using SD, it also came to be a bit of a working folder for me (i.e., saving pose pictures when I'm creating poses, so they will be deleted again and don't stay in a folder where I maybe forget them). So, occasionally the temp folder will be deleted and with it the sd-temp-files folder.

if you delete it manually, then yes, thats a problem.

Well, maybe I'm wrong, but shouldn't the main program take care of such things? To watch if every folder is accessible during runtime?
And isn't there any "report" from scripts/extensions, that the temp folder is gonna needed and then it will be checked again if it's existing?
Just a naive thought of mine.

And while we are at it again: those empty temp folder that being created ... do you already know from where they come and why they are not created in the system set temp folder?

@vladmandic
Copy link
Owner

ideally, yes, you're right. but if someone takes away a floor you're standing on, it takes a lot of exception handling not to fall. i'd have to trace down every instance where temp folder may be referenced to and wrap it. should had it be done correctly from the start? yes. but while i'm fixing old code, this is pretty low on priority list.

re: temp files outside of it, i'll check.

midcoastal pushed a commit to midcoastal/automatic that referenced this issue Dec 7, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants