Skip to content

Latest commit

 

History

History
80 lines (56 loc) · 1.36 KB

README.md

File metadata and controls

80 lines (56 loc) · 1.36 KB

Problem

Making a ListObjectsV2 request to a local S3 bucket through Go AWS SDK V2 returns an empty response. The unexpected behavior is that LocalStack logs it as an s3.ListBuckets request, whereas it should log as s3.ListObjectsV2.

Steps to reproduce

  1. Run LocalStack
  2. Create a local S3 bucket
aws --endpoint-url=http://localhost:4566 \
  s3api create-bucket \
  --bucket my-bucket \
  --region ap-northeast-2 \
  --create-bucket-configuration LocationConstraint=ap-northeast-2
  1. Upload a file to the bucket
aws --endpoint-url=http://localhost:4566 s3 cp sample.jsonl s3://my-bucket/my-prefix/sample.jsonl
  1. Run Go code
cd go
go run test.go

The result will be:

Total objects:  0

The log of LocalStack will be:

INFO --- [   asgi_gw_0] localstack.request.aws     : AWS s3.ListBuckets => 200
  1. Run Python code (optional)

When making a request using Python code, the operation works as expected.

cd python
python test.py

The result will be:

Object name: my-prefix/sample.jsonl
Total objects: 1

The log of LocalStack will be:

INFO --- [   asgi_gw_1] localstack.request.aws     : AWS s3.ListObjectsV2 => 200

Versions

LocalStack

localstack==2.3.2
localstack-client==2.3
localstack-core==2.3.2
localstack-ext==2.3.2

OS

macOS Monterey 12.6.3