-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Could not upload to S3 with ECS Fargate #1867
Comments
Hi @zeroiszero, thanks for reaching out to us. cURL Error 7 is caused by a failure to connect to the target host, which suggests there is something blocking or dropping the connection from your Fargate container to S3. Are you able to reach the S3 endpoint for the region in which your bucket resides using your container without using the AWS SDK for PHP? E.g. using As a side note, I see you're using version 3.18 of the AWS SDK for PHP. While this shouldn't affect your ability to connect to S3, this version was released in April of 2016 and is 90 minor versions behind the latest release. I strongly suggest updating the SDK to a newer version as there have been quite a few bug fixes and improvements implemented between these two versions that should result in an overall better experience using the SDK. |
Hi, @diehlaws Checked. No issue connect to S3 enpoint. Updated the SDK version as well, still the same. As I traced the code, its turn out that cURL error is coming from the SDK when its trying to connect |
Solved. It was caused by php-fpm configuration that deleted the environment variables when docker started php-fpm processes.
To fix this, set
|
hi @zeroiszero , I try like you did, but still error |
I am so glad I found this post, I was really beginning to lose hope. I'm not sure if it matters much, but rather than preventing FPM from clearing environment variables you could pass I added the line to /etc/php-fpm.d/www.conf:
Below the section:
|
Hi, I am running WordPress with ECS Fargate and
TaskRoleArn
defined in Task DefinitionVersion of AWS SDK for PHP?
Version of PHP (
php -v
)?What issue did you see?
Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 7: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/html/wp-content/plugins/s3-uploads/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:185 Stack trace: #0 /var/www/html/wp-content/plugins/s3-uploads/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(149): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 /var/www/html/wp-content/plugins/s3-uploads/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(102): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlMultiHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 /var/www/html/wp-content/plugins/s3-uploads/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(181): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlMultiHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 /var/www/html/wp-content/plugins/s3-u in /var/www/html/wp-content/plugins/s3-uploads/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 185
Steps to reproduce
Run S3
putObject
as in this example.Credentials not provided as I assume the SDK will retrieve from the IAM role.
Also tried the task role attached with the policy
AmazonS3FullAccess
. Still the same error.The text was updated successfully, but these errors were encountered: