-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
AzureBlobTarget: use file basename for the temp download_file_location #3009
base: master
Are you sure you want to change the base?
AzureBlobTarget: use file basename for the temp download_file_location #3009
Conversation
When the target blob is inside a path (for instance "path/to/target") and we use `download_when_reading=True`, the directory layout doesn't exist and it fails with: ``` File "src/luigi/luigi/contrib/azureblob.py", line 194, in __enter__ self.client.download_as_file(self.container, self.blob, self.download_file_location) File "src/luigi/luigi/contrib/azureblob.py", line 101, in download_as_file return self.connection.get_blob_to_path(container, blob, location) File "src/luigi/venv/lib/python3.6/site-packages/azure/storage/blob/baseblobservice.py", line 1765, in get_blob_to_path with open(file_path, open_mode) as stream: FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/7q/l5knvjqx3pg569hwsdrzjw480000gn/T/2020-10-12 14:20:01.950869689rh5q2/path/to/movie-cheesy.txt' ``` Use `os.path.basename(blob)` to keep only the blob name as file name instead of the full path (it's written in a temporary directory anyway)
CI failed with:
I don't know why, it's just during a file upload I also noticed that |
gentle bump on this, would it be possible to re-run CI? I'd like to see if the failing test still happens before trying to solve it |
restarted ci tests |
thanks, I was able to reproduce the failing test using Azurite locally and will work on a fix. |
bb2cf48
to
a434042
Compare
I reproduced the issue with Azurite, the failure seemed to be a bug with the lease when re-using the same blob name I upgraded Azurite Docker image in the CI scripts from the deprecated https://github.com/arafato/azurite to the official https://github.com/azure/azurite and the issue is gone |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions. |
Motivation and context
When the target blob is inside a path (for instance "path/to/target") and we use
download_when_reading=True
,the directories don't exist and reading the target fails with:
Description
Use
os.path.basename(blob)
to keep only the blob name as file name instead of the full path (it's written in a temporary directory anyway)I changed a test task target to
"path/to/movie-cheesy.txt"
instead of"movie-cheesy.txt"
I added a test that reproduces the issue.