Open thekorn opened 11 years ago
I needed to patch fake-s3 to handle a case that led to same exact behavior:
https://github.com/robguttman/fake-s3/commit/7bfc57ede19466d6b6be489b30557be7d6f610f7
May or may not be your problem though.
On Jan 5, 2013, at 1:25 PM, Markus Korn notifications@github.com wrote:
I'm using HEAD of fakes3, and whenever I restart the fakes3 server lookinng up keys is not working anymore, I always get an empty list of objects for each bucket.
— Reply to this email directly or view it on GitHub.
I'm seeing the exact same problem using the AWS-S3 ruby gem. Everything works great, but after server restart I get "AWS::S3::NoSuchKey ". Checking the fakes3 folder, the files are there.
The proposed patch is not working.
Any ideas on what could cause this?
I worked around this locally with the following changes in lib/fakes3/file_store.rb:
19c19
< bucket_obj = Bucket.new(bucket_name,Time.now,[])
---
> bucket_obj = Bucket.new(bucket_name,Time.now,get_objects(bucket_name, bucket))
199a200,206
>
> private
> def get_objects bucket_name, path
> Dir[File.join(path, '*')].map do |filepath|
> get_object(bucket_name, File.basename(filepath), nil)
> end
> end
I just had the same problem - objects are no longer listed after restarting the server, although I can still GET them. I applied the fix from dterhorst and it worked. This would be a good pull request.
I had to use a combination of fixes here to get it working in my fork:
I'm using HEAD of fakes3, and whenever I restart the fakes3 server lookinng up keys is not working anymore, I always get an empty list of objects for each bucket.