Comments (11)
OK, I was able to fix the issue by using the -H
argument of fakes3
to set the hostname of the server to the same hostname I was using in my client. It should really be documented somewhere that this is necessary. I'm not sure why but my programs seem to continue to work fine without the hostname until I try to list objects.
from fake-s3.
I am hitting the same issue.
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.4.3</version>
</dependency>
You can find my testcase over here:
https://gist.github.com/anonymous/5579687
When I execute this TestCase I get the following xml back from the server: https://gist.github.com/philippe-tseyen/5579744
from fake-s3.
While trying to reproduce this issue, I found that it depends on the HTTP Host header:
$ curl -H 'Host: localhost:4569' http://localhost:4569/my_bucket/
<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>my_bucket</Name><Prefix/><Marker/><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated><Contents><Key>the_key</Key><LastModified>2017-11-20T14:35:30.139Z</LastModified><ETag>"3a37d03e20b3b3245b460349de1e4057"</ETag><Size>9</Size><StorageClass>STANDARD</StorageClass><Owner><ID>abc</ID><DisplayName>You</DisplayName></Owner></Contents></ListBucketResult>
$ curl -H 'Host: blablabla:4569' http://localhost:4569/my_bucket/
<?xml version="1.0" encoding="UTF-8"?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist</Message><Key>my_bucket</Key><RequestId>1</RequestId><HostId>2</HostId></Error>
The problem seems to be here: https://github.com/jubos/fake-s3/blame/8dc0734c3d6b308dc033541c57f63729e806696a/lib/fakes3/server.rb#L486-L489
from fake-s3.
Andrew,
Thanks for the bug report. I think there needs to be a PHP AWS SDK unit test file, so we can get to the bottom of it. All the different language SDKs tend to tickle the AWS API calls a little bit differently, so it is all about getting all the edge cases.
from fake-s3.
I have the same issue, listObjects returns empty structure (AWS-SDK for JavaScript).
from fake-s3.
Yeah listObjects is returning an empty structure for me as well
from fake-s3.
Using boto3(1.4.1), and running fake-s3 in https://hub.docker.com/r/lphoward/fake-s3/.
Most operations such as head_object, get_object, put_object are ok. But calling client.list_objects throws an exception.
File "/usr/local/lib/python3.4/dist-packages/botocore/client.py", line 159, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.4/dist-packages/botocore/client.py", line 494, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (NoSuchKey) when calling the ListObjects operation: The specified key does not exist
On the other hand, If I put an object bar
to bucket foo
through endpoint_url='http://ct-s3:4569', I get path /fakes3_root/ct-s3/foo/bar
in docker. And executingaws --endpoint-url='http://localhost:4569' s3 ls
returns ct-s3
, not foo
. Calling client.list_objects(Bucket='ct-s3')
get the same exception.
from fake-s3.
having same problem with curl:
http://192.168.99.100:4569/test?list-type=2&max-keys=10&prefix=%2Fownership&start-after=
returning
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>test</Name>
<Prefix>/ownership</Prefix>
<Marker/>
<MaxKeys>10</MaxKeys>
<IsTruncated>false</IsTruncated>
</ListBucketResult>
instead of objects
from fake-s3.
that URL was generated from the golang sdk
from fake-s3.
can confirm this doesn't work in node using aws-sdk
either.
from fake-s3.
having same problem with curl:
http://192.168.99.100:4569/test?list-type=2&max-keys=10&prefix=%2Fownership&start-after=
That example uses ListObjectV2 which I believe may not be supported yet in this project?
from fake-s3.
Related Issues (20)
- [Feature] Add support of payer option, to allow usage with ansible s3_bucket library
- fakes3 error
- [Bug] Error message "undefined method `gsub' for nil:NilClass" when attempting to store something.
- [Bug] Multipart Upload Fails for Large Files
- Incorrect behavior when using Prefix HOT 1
- [Other] LoadError: load error: jopenssl/load -- java.lang.IncompatibleClassChangeError: Implementing class
- [Bug] X-Amz-Content-Sha256 is not allowed for upload
- [Feature] Multipart upload more descriptive error message for uploading one part HOT 2
- License timebomb should be a major version HOT 3
- [Question] Next release? HOT 1
- [Feature] Support GET Bucket requestPayment
- [QUESTION] Where I can find the CI service? HOT 1
- [Bug] Deleting "fake" directories
- [Bug] Licensing does not work for certain valid email addresses HOT 5
- [Bug] Cannot upload files with size > 2GB
- [Question]: Are files actually created when uploading or is file creation simulated?
- [Bug] Prevent directory traversal
- "rake test_sever" not working in windows. is there any way to resolve this ? HOT 1
- Ruby 3.1 compatibility HOT 1
- [Feature] Support for AWS v3 SDK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fake-s3.