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

FileNotFoundError on os.getcwd() #464

Open
stijn-uva opened this issue Nov 18, 2024 · 3 comments
Open

FileNotFoundError on os.getcwd() #464

stijn-uva opened this issue Nov 18, 2024 · 3 comments

Comments

@stijn-uva
Copy link
Member

stijn-uva commented Nov 18, 2024

Worker upload-search raised exception FileNotFoundError and will abort: [Errno 2] No such file or directory at worker.py:117->processor.py:168->helpers.py:148

cwd = os.getcwd()

This can occur if the working directory was previously changed to a directory that no longer exists at the time of the call. Are we setting the working directory to a temporary directory without changing it back anywhere?

@stijn-uva
Copy link
Member Author

Confusingly, all our os.chdir()s are wrapped in try/catch blocks with a finally statement that changes the working directory back to the original value...

@stijn-uva
Copy link
Member Author

Got rid of chdir, which isn't particularly thread-safe, in 9197c99 but the problem remains (FileNotFoundErrors start popping up in other places). To be continued...

@dale-wahl
Copy link
Member

I believe the errors related to the video hasher are unrelated and pushed a fix.

Not sure if you noted other errors as well, but the cwdir seems like the culprit here since it seems to effect the main process and thus all threads owned by it. Not 100% sure why the finally block was not always called, but even without that we could get shutil errors while the directory was changed so it seems good to remove and avoid it in general.

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

No branches or pull requests

2 participants