-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 putObject + localstack = Could not contact remote server #1325
Comments
Did you tried: https://async-aws.com/clients/s3.html#non-aws-s3-endpoints ? |
Yes. But one interesting thing. I tried to use two hosts: localhost and 127.0.01. Here is my first config:
it's possible to get a list of buckets but it wasn't possible to get a file list (listObjectsV2 -> Could not contact remote server.) but when I changed the endpoint to
I can get a list of files. So, I decided to add mentioned option
and I can use localhost:4566 and can see a list of files. so maybe something is wrong with the endpoint for putObject? |
When I'm using aws sdk (https://github.com/aws/aws-sdk-php) everything is ok. https://gist.github.com/dudekm/e4ec6600f34fd50dac0622903034a09e so, probably problem is inside async-aws :( |
Thanks for the reproducer. I tried to start the stack on my local machine, but I'm not able to make it work. Local stack stuck even when using I replaced If you want, you can add a logger to get more information about the requests performed by AsyncAws: use Symfony\Component\Console\Logger\ConsoleLogger;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
include(__DIR__.'/vendor/autoload.php');
$logger = new ConsoleLogger(new ConsoleOutput(OutputInterface::VERBOSITY_VERY_VERBOSE));
// Instantiate an Amazon S3 client.
$s3 = new S3Client([
'endpoint' => 'http://localhost:4569',
'pathStyleEndpoint' => true,
], new NullProvider(), null, $logger); |
Current code and result https://gist.github.com/dudekm/ccb06aafb7e2309497fe63cd571c08c3 Doesn't matter if Did you try running the code from my first post? BEcause this one is related to I will try to prepare a repository with docker, nginx, php, localstack, and my php code. The environment will be the same for everyone, and we can test php code. |
I ran into the same issue, but with SQS. Gave up after hours of banging my head against the wall, trying all possible combinations of configurations. Both localstack and asyncaws/testing-sqs did not work for me with fullstack Symfony (Messenger + sqs-messenger + async-aws + async-aws/symfony-bundle). Connection with aws cli works fine, but with async-aws it does not. |
Hi.
I'm using async-aws with localstack to mock requests and I have a problem with putObject. Here you can find my PHP and JavaScript code to check if it works -> https://gist.github.com/dudekm/807f94dcc37a51adf43ec9e8b3652238
PHP + ASYNC-AWS + localstack - doens't work
I can list buckets and files - everything works perfectly. Logs from localstack:
localstack_demo | 2022-11-08T06:54:51.842 INFO --- [ asgi_gw_0] localstack.services.infra : Starting mock S3 service on http port 4566 ... localstack_demo | 2022-11-08T06:58:24.996 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.ListBuckets => 200 localstack_demo | 2022-11-08T06:58:25.008 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.ListObjectsV2 => 200
But when I want to use putObject, it's not possible because of "Could not contact remote server" and in localstack I can't see any request related to putObject.
JavaScript + AWS SDK + localstack - works
I decided to test if JavaScript aws-sdk will work. The upload works perfectly.
localstack_demo | 2022-11-08T06:58:22.476 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.PutObject => 200
For sure it's not a problem with localstack (for JS sdk everything is fine). So, looks like async-aws has a bug or my config for async-aws is not correct. But, is it possible that config is not correct only for putObject???
The text was updated successfully, but these errors were encountered: