Giter Club home page Giter Club logo

Comments (11)

alexmojaki avatar alexmojaki commented on September 4, 2024 12

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.

philippe-tseyen avatar philippe-tseyen commented on September 4, 2024 1

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.

alexmojaki avatar alexmojaki commented on September 4, 2024 1

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.

jubos avatar jubos commented on September 4, 2024

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.

petermilan avatar petermilan commented on September 4, 2024

I have the same issue, listObjects returns empty structure (AWS-SDK for JavaScript).

from fake-s3.

bbCharles avatar bbCharles commented on September 4, 2024

Yeah listObjects is returning an empty structure for me as well

from fake-s3.

fireice009 avatar fireice009 commented on September 4, 2024

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.

tobowers avatar tobowers commented on September 4, 2024

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.

tobowers avatar tobowers commented on September 4, 2024

that URL was generated from the golang sdk

from fake-s3.

yjhuoh avatar yjhuoh commented on September 4, 2024

can confirm this doesn't work in node using aws-sdk either.

from fake-s3.

CpuID avatar CpuID commented on September 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.