mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #5642] issue: windows Functions - [WinError 32] The process cannot access the file because it is being used by another process #14066
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tjbck on GitHub (Sep 23, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/5642
Discussed in https://github.com/open-webui/open-webui/discussions/5606
@tjbck commented on GitHub (Sep 23, 2024):
@EtiennePerot Related #5511
@EtiennePerot commented on GitHub (Sep 24, 2024):
Hmm. It seems like it is complaining that a file is being accessed from multiple processes, but the code specifically closes the temporary file prior to calling
exec(by virtue of ending thewithblock):6b463164f4/backend/open_webui/apps/webui/utils.py (L87-L97)I don't have a Windows machine to test this on either, but the Python documentation on
tempfile.NamedTemporaryFilehelpfully states:So I think adding
delete_on_close=Falseshould suffice, given that the file is deleted later in thefinallyblock. I can send a PR for that soon.EDIT: This is incorrect. See comment below.
@tcgumus commented on GitHub (Sep 24, 2024):
faced the same problem with the latest build on windows. @EtiennePerot does your solution solves it? I will try it today.
@EtiennePerot commented on GitHub (Sep 24, 2024):
No, I was wrong above.
NamedTemporaryFileactually keeps an open file handle, and the problem is actually from theos.unlinkcall later in the function that tries to remove it while the handle is still open. This is OK in POSIX but not in Windows. I just sent #5649 which should fix it by closing the file handle returned byNamedTemporaryFile, which works on either platform.@tcgumus commented on GitHub (Sep 24, 2024):
Yes. #5649 solved my problem on windows. thanks @EtiennePerot 👏
@tjbck commented on GitHub (Sep 24, 2024):
Thanks everyone!
@github-pmj commented on GitHub (Sep 24, 2024):
Just upgraded to 0.3.28 - issue resolved - thanks all for your efforts