- Issue created by @liliplanet
- πΊπΈUnited States aasarava
I'm having the same issue. S3FS validation shows that the authentication to my S3 bucket is working just fine. But when I try to create a new node that has an S3 Cors field on it, the module times out and I get the following error.
Aws\Exception\CredentialsException: Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1012 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) in Aws\Credentials\InstanceProfileProvider->handleRetryableException() (line 300 of /app/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php).
I'm not sure why it's trying to access the 169.254.169.254 local AWS endpoint, since I'm not running this on an EC2 instance.
This appears to get triggered from this SDK call in Element/S3fsCorsFile.php:
$sessionToken = $sts->getFederationToken([ 'Name' => 'User1', 'DurationSeconds' => '3600', 'Policy' => json_encode([ 'Statement' => [ 'Sid' => 'drupals3fscorsid' . time(), 'Action' => [ "s3:PutObject", "s3:GetObjectAcl", "s3:GetObject", "s3:DeleteObjectVersion", "s3:PutObjectVersionAcl", "s3:GetObjectVersionAcl", "s3:DeleteObject", "s3:PutObjectAcl", "s3:GetObjectVersion", ], 'Effect' => 'Allow', 'Resource' => $sts_policy_resource, ], ]), ]);
I do see that the version of the aws/aws-sdk-php library that I have is 3.325.3. I tried to downgrade to 3.18 as shown in s3fs's composer.json, but that conflicts with guzzle 7.
Anyone have any suggestions? Is there an issue with my bucket or IAM setup that I need to resolve? Or is this due to a change in the SDK?
(Changing this to a support request for now.)