-
Notifications
You must be signed in to change notification settings - Fork 656
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
Bug: PermissionError: [WinError 5] while uploading dataset #1348
Comments
@Octoslav are you saying that os.replace() raised by error by mistake? Or was there a concrete reason for it? |
As far as I know the race condition can occur: shutil.move is a high level function and can handle such a case. |
@jkhenning Hi! Do you have any thoughts? The error is quite annoying for windows users in my team. |
The solution seems OK to me, I'm just not comfortable with hiding errors in general 😄 |
Didn't managed to reproduced it on linux machines
I didn't hide the error, I just used an another instrument that works better on Windows |
Any idea on the implications of this change in linux or other platforms? |
Describe the Bug
When uploading a dataset using
clearml-data sync
on Windows, the following error intermittently occurs:PermissionError: [WinError 5] Access is denied
.Investigation
The error is triggered on the following line in the code:
https://github.com/allegroai/clearml/blob/master/clearml/binding/artifacts.py#L1141C18-L1141C19.
This issue is unstable and difficult to reproduce consistently. However, it becomes a significant problem when working with large datasets. For instance, my team faced this error while attempting to upload a dataset containing 700 000 items. The process took approximately 5 hours to compute all file hashes, only for the
WinError 5
to unexpectedly appear.Steps to Reproduce
The following script simulates the aforementioned line of code and demonstrates the issue:
When running this script on multiple Windows machines, I observed about 6
PermissionError
exceptions over 100 000 iterations.Running the script as administrator does not resolve the issue.
Possible Solution
I suggest replacing the use of
os.replace(local_filename, temp_filename)
withshutil.move(local_filename, temp_filename)
. Both methods achieve the same functionality, butshutil.move
does not raise thePermissionError
on Windows.The text was updated successfully, but these errors were encountered: