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

fix: Windows permission error on ingest service tmp files #1280

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

FrangSierra
Copy link
Collaborator

@FrangSierra FrangSierra commented Nov 19, 2023

The ingestion API causes some permission troubles over the temporal files on Windows. A fix was recently added here #1260 but the unlinking causes a different trouble. On big files another PermissionError is throw because the file still being used by another process.

  File "E:\PycharmProjects\privateGPT\private_gpt\server\ingest\ingest_service.py", line 124, in ingest
    path_to_tmp.unlink()
  File "C:\Users\frang\.pyenv\pyenv-win\versions\3.11.0\Lib\pathlib.py", line 1147, in unlink
    os.unlink(self)
    PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\frang\\AppData\\Local\\Temp\\tmp4v0e9vnh'

Still being a permission error and It dont happen with small files. But closing the file before unlinking the path fix it for both cases on Windows 10. This might fix #1227

Copy link
Collaborator

@imartinez imartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Great catch!

@imartinez imartinez merged commit f1cbff0 into zylon-ai:main Nov 20, 2023
6 checks passed
simonbermudez pushed a commit to simonbermudez/saimon that referenced this pull request Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API triggered document ingestion on Windows causes permission error
2 participants