-
Notifications
You must be signed in to change notification settings - Fork 304
deleteRemoved
option with downloadDir
causes some local directories to disappear entirely
#54
Comments
Thanks for the report and the test case. I haven't taken a look at this yet, but it looks like a serious issue that needs to be solved. Nothing immediately comes to mind but I plan to dig into it within a couple weeks. Feel free to dig in yourself if you want things to happen sooner. |
enabled. * allS3Objects should not contain the directory specified by 'prefix'. Fixes andrewrk#54
I've been trying to reproduce this issue and I can't seem to get it to happen. Also, looking at the code, I don't understand why it would happen or why your fix would solve it. Do you think you could whip up a .tar.gz with some example code that demonstrates the problem? |
@andrewrk Thanks for looking at this issue. While trying to reproduce this, I realized there was a bit more to the story than I originally thought and described. Basically, the issue is only observed if you are to manually create the directory in an S3 bucket (from the S3 management console), and then upload contents to it. It doesn't happen when the entire directory is uploaded to a bucket. Let me try to elaborate, with screenshots to avoid any confusion: Code for the downloadThe code is very straightforward. It's all in this gist. Directory structureI created a directory on my local system,
Scenario 1: Upload entire directory to S3 bucket (works as expected)I set up a bucket and uploaded the entire When I then execute the code to download from the bucket and Scenario 2: Create a directory in a bucket then upload contents (subdirectory gets deleted on download):Here, I first create a new directory inside the bucket, When I execute the code to download from the bucket and Hope that helps clear things up! |
I got the same problem... +1 for finding the working/failing cases... Wasnt easy. |
I can reproduce the issue. Files on S3 were created manually. |
I am also experiencing this error scenario now.. I am noticing that when you create the scenario on s3 by hand s3 creates 'directory' objects for empty directories.. It seems this might be causing an error in the special case scenario in checkDoMoreWork() for handling directory matching. Fixed in merge request below. |
I'm trying to download the content of an entire directory from an S3 bucket. The directory contains two subdirectories, which themselves contain a bunch of files. It essentially looks something like this:
The first time that I call
downloadDir()
with thedeleteRemoved
flag set totrue
, both subdirectories (foo
andbar
in this example) download to a local directory as expected:However, on each subsequent
downloadDir()
call, something weird happens: the localtarget-dir
ends up with only one directory left. Sometimes, it'sfoo
, and sometimes, it'sbar
.The code for the download is pretty straightforward:
I haven't been able to dig into this project's code yet, but is there something that might immediately come to mind?
The text was updated successfully, but these errors were encountered: