0

I am trying to use the sqs queue peeking api documented here (using both the path method and the query param method): https://docs.localstack.cloud/user-guide/aws/sqs/#peeking-into-queues

And the response is an s3 error (s3 was not enabled):

curl "http://localhost:4566/_aws/sqs/messages?QueueUrl=http://queue.localhost.localstack.cloud:4566/000000000000/queue"
<?xml version='1.0' encoding='utf-8'?>
<ErrorResponse><Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><Type>Sender</Type></Error><RequestId>W9WPTXP97BNLX1TFB2VU703TA8TPENLVJ3TBOQ4IS9DMWNJ4SR27</RequestId></ErrorResponse>%

My docker compose environment variables:

environment:

  • AWS_DEFAULT_REGION=us-east-1
  • DEFAULT_REGION=us-east-1
  • EDGE_PORT=4566
  • SERVICES=sns, sqs
  • LS_LOG=trace ports:
  • '4566:4566' volumes:

Has someone experienced this before? How should I fix this?

Thanks in advance!

Edit: log from container:

GET localhost:4566/_aws/sqs/messages?QueueUrl=http://queue.localhost.localstack.cloud:4566/000000000000/queue 2023年01月26日T17:52:02.045 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.GetObject => 404 (NoSuchBucket); GetObjectRequest({'Bucket': '_aws', 'IfMatch': None, 'IfModifiedSince': None, 'IfNoneMatch': None, 'IfUnmodifiedSince': None, 'Key': 'sqs/messages', 'Range': None, 'ResponseCacheControl': None, 'ResponseContentDisposition': None, 'ResponseContentEncoding': None, 'ResponseContentLanguage': None, 'ResponseContentType': None, 'ResponseExpires': None, 'VersionId': None, 'SSECustomerAlgorithm': None, 'SSECustomerKey': None, 'SSECustomerKeyMD5': None, 'RequestPayer': None, 'PartNumber': None, 'ExpectedBucketOwner': None, 'ChecksumMode': None}, headers={'Host': 'localhost:4566', 'User-Agent': 'curl/7.77.0', 'Accept': '/', 'x-localstack-tgt-api': 's3', 'Authorization': 'AWS4-HMAC-SHA256 Credential=000000000000/20160623/us-east-1/s3/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=1234', 'x-localstack-edge': 'http://localhost:4566', 'X-Forwarded-For': '127.0.0.1, localhost:4566', 'Connection': 'close'}); NoSuchBucket(The specified bucket does not exist, headers={'Content-Type': 'text/xml', 'Content-Length': '258', 'x-amz-request-id': 'Z45RC1D5WHI9WLFRZXV7ARWF3VRVL1V26XCUFDVV946B5XRMA1JN', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'Access-Control-Allow-Headers': 'authorization,cache-control,content-length,content-md5,content-type,etag,location,x-amz-acl,x-amz-content-sha256,x-amz-date,x-amz-request-id,x-amz-security-token,x-amz-tagging,x-amz-target,x-amz-user-agent,x-amz-version-id,x-amzn-requestid,x-localstack-target,amz-sdk-invocation-id,amz-sdk-request', 'Access-Control-Expose-Headers': 'etag,x-amz-version-id'})

asked Jan 26, 2023 at 18:42
1
  • I've also been having this problem with S3 in the localstack container. Did you manage to solve it? Commented Mar 3, 2024 at 23:38

1 Answer 1

-1

Hi — Can you pull the latest LocalStack Docker image:

docker pull localstack/localstack:latest

After that, please set your Compose configuration as:

version: "3.8"
services:
 localstack:
 container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
 image: localstack/localstack:latest
 ports:
 - "127.0.0.1:4566:4566" # LocalStack Gateway
 - "127.0.0.1:4510-4559:4510-4559" # external services port range
 environment:
 - DEBUG=${DEBUG-}
 - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
 - DOCKER_HOST=unix:///var/run/docker.sock
 - LOG_LOG=trace
 volumes:
 - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
 - "/var/run/docker.sock:/var/run/docker.sock"

The SERVICES configuration has been deprecated. After starting the LocalStack container, you can now run the following to verify that the SQS developer endpoints are working:

$ awslocal sqs create-queue --queue-name my-queue
$ awslocal sqs send-message --queue-url http://localhost:4566/00000000000/my-queue --message-body test
$ curl "http://localhost:4566/_aws/sqs/messages?QueueUrl=http://queue.localhost.localstack.cloud:4566/000000000000/my-queue"

This should work accurately now!

answered Jan 27, 2023 at 5:54
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.