Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

No objects after restart of fakes3 #22

Open
thekorn opened this issue Jan 5, 2013 · 5 comments · May be fixed by #221
Open

No objects after restart of fakes3 #22

thekorn opened this issue Jan 5, 2013 · 5 comments · May be fixed by #221

Comments

@thekorn
Copy link

thekorn commented Jan 5, 2013

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.

@robguttman
Copy link

I needed to patch fake-s3 to handle a case that led to same exact behavior:

robguttman@7bfc57e

May or may not be your problem though.

  • Rob

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.

@runemadsen
Copy link

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?

  • Rune

@dterhorst-zz
Copy link

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

@mark2997
Copy link

mark2997 commented Sep 8, 2014

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.

@saltzmanjoelh
Copy link

I had to use a combination of fixes here to get it working in my fork:

https://github.com/saltzmanjoelh/fake-s3

LoreleiAurora added a commit to howtoadhd/docker.dev-services that referenced this issue Dec 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants