zero01101/openOutpaint-webUI-extension

[Bug]: installation from A1111 UI error: "PermissionError: [WinError 5] Access is denied"

Opened this issue · 4 comments

Is ths issue about the extension?

  • Yup, this is for sure about the extension

What happened?

Installation from A1111 UI error: PermissionError: [WinError 5] Access is denied: 'G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension' -> 'G:\\stablediffusion\\extensions\\openOutpaint-webUI-extension'

Steps to reproduce the problem

Given install path in G:\\stablediffusion\\

  1. Go to the list of available extensions
  2. Install openOutpaint extension
  3. See the error
  4. See G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension is created, and only contains a .git folder
  5. Try install again
  6. See error message saying G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension already exists and is not empty

=> deleting G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension and trying again yields the same result
=> permissions on directories G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension and G:\\stablediffusion\\extensions\\openOutpaint-webUI-extension as open as it gets
=> webui-user.bat started as user and as administrator yields the same result

What should have happened?

Extension should be installed

Commit where the problem happens

unknown, cannot install

What platforms do you use to access openOutpaint?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Browser Extensions/Addons

Fresh install

AUTOMATIC1111 webUI Commandline Arguments

--xformers

Additional information

Console trace

Error completing request
Arguments: ('https://github.com/zero01101/openOutpaint-webUI-extension.git', ['ads', 'localization', 'installed'], 0, 'outpa') {}
Traceback (most recent call last):
  File "G:\stablediffusion\modules\call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "G:\stablediffusion\modules\ui_extensions.py", line 179, in install_extension_from_index
    ext_table, message = install_extension_from_url(None, url)
  File "G:\stablediffusion\modules\ui_extensions.py", line 167, in install_extension_from_url
    raise err
  File "G:\stablediffusion\modules\ui_extensions.py", line 159, in install_extension_from_url
    os.rename(tmpdir, target_dir)
PermissionError: [WinError 5] Access is denied: 'G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension' -> 'G:\\stablediffusion\\extensions\\openOutpaint-webUI-extension'

terribly sorry for the delay; i honestly don't quite know what to tell you on this one, as it's almost certainly to do with a local permission issue and i haven't been able to reproduce it on windows (nor linux but you're pretty obviously using windows...) - a cursory search suggests it's a python/pip issue... do any other extensions do that?

i have also encounted the same issue on v1.1.0 of A1111 webui on Windows 10, same error logs (but line numbers different).

a workaround i've found is to directly clone it yourself. open git bash (or any terminal with git) in the extensions folder then run git clone --recurse-submodules https://github.com/zero01101/openOutpaint-webUI-extension. do some UI reloads or something to have it show in extensions list and then Apply and Restart UI.

speculation: maybe it's an app using/doing something inside the folder, so Windows denies the folder move?

I've been running into this myself for the last couple of days after buying a new external hard drive and reformatting it to NTFS and trying to install a fresh clone of everything into it.

... do any other extensions do that?

Yes, a few. Off the top of my head specifically, Dreambooth. Edit: Also Controlnet. It would appear that anything that requires the use of the tmp folder while installing ends up being smacked with ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied

And while searches do seem to point the finger at python, or pip, or drive permissions in general, I can tell you having spent the past two days nearly nonstop working on this, exhausting all options where as far as setting permissions and using TAKEOWN strings at command lines are concerned ... literally everything the internet says to do dealing with this particular problem, to absolutely no avail. It's like no matter what I do, nothing 'takes', ya know?

Thanks to NutchapolSal for the work around idea though. I'll try that next.

I don't have much experience in Python specifically, but as NutchapolSal wondered, it does sound very much like a file-lock issue where some process still has hold of something.

Whether this locked 'something' is the (source?) directory G:\\stablediffusion\\tmp\\openOutpaint-webUI-extension itself, and/or one or more files within it, or the other (destination?) directory and/or one/more files inside it will depend on various factors such as how the Python script is copying/moving things around.

In any case my money would be on one of several processes: python.exe, explorer.exe, git.exe or possibly docker if you're using that.

It's interesting that whilst Python doesn't seem to be allowed to alter the source and/or destination directory, git does. That might suggest that some git.exe process is the culprit.

It might also be a virus scanner locking it.

You mentioned you've been working on it for days - have you done a full reboot in that time?

I do find that this sort of thing is often Explorer.exe, itself though, which is usually easily sorted by going into Task Manager > Details tab, sort by Name, then End Task on any explorer.exe processes in the list. At that point the any file explorer windows will close, as will the Task Bar. Once the processes have definitely stopped, then running explorer.exe again from the Task Manager's Run Task menu item should bring it up again.
Note that you might not get back the File Explorer windows so make a note of what directories you had open before ending Explorer.exe

Also ensure that you don't have any Terminal or command prompt open that have accessed either of the two directories in question (especially if they're currently cd'd into one of those directories).

The File Locksmith from Windows Power Toys suite might help to figure out which process is causing the lock.

I hope you can get the problem identified - I was only here because I was about to install the extension but, being on reForge at the moment thought I'd check for any compatibility issues :-)

All the best