Skip to content
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

After update Version 3.187.0 = DynamoDB Error retrieving credentials from the instance profile metadata #2281

Closed
emkcloud opened this issue Aug 3, 2021 · 26 comments
Assignees

Comments

@emkcloud
Copy link

emkcloud commented Aug 3, 2021

I current use this environment

aws/aws-sdk-php 3.186.4 AWS SDK for PHP - Use Amazon Web Services in your PH...
aws/aws-sdk-php-laravel 3.6.0 A simple Laravel 5/6/7/8 service provider for includ
laravel/framework v8.53.0 The Laravel Framework.
laravel/nova 3.27.0 A wonderful administration interface for Laravel.

If I execute composer update for upgrade SDK version 3.187.0 receive this. The problem is DynamoDB thatt i use for driver Cache and Session in Laravel. If change Driver from DYNAMODB to FIle.. no reveive error, but if i use dynamodb exception in all pages my application..

image

If downgrade return all OK

@emkcloud emkcloud added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2021
@SamRemis
Copy link
Member

SamRemis commented Aug 3, 2021

@massimodellarovere I think I know what caused this, and am working on a fix right now. Please stand by

@SamRemis
Copy link
Member

SamRemis commented Aug 3, 2021

@massimodellarovere, just merged the fix. Please get the latest then try again and let me know if it's fixed

@SamRemis SamRemis added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2021
@emkcloud
Copy link
Author

emkcloud commented Aug 3, 2021

image
Update with dev-master is OK .. I not receive error

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Aug 4, 2021
@jonnycbw
Copy link

jonnycbw commented Aug 4, 2021

@SamRemis This is still an issue with production and affects more services than just DynamoDB, when will this be merged?

@mgilberties
Copy link

@SamRemis Any idea on the ETA for this one being merged in and released as a tagged version? It's wiped a fair few systems out.

@SamRemis
Copy link
Member

SamRemis commented Aug 4, 2021

@jonnycbw @mgilberties I have already merged it, so depending on how you download the release, it should have already been fixed. I will release a tagged version to make sure it propagates faster

In case I'm wrong, I could use a larger error message to know for sure what the issue is

@mgilberties
Copy link

@SamRemis - Nice one. We were installing using composer and it doesn't appear to be pulling the latest changes without the tag. We have manually set our systems to use 3.186.1 for now. This is the error we were getting across numerous instances:

[2021-08-04 12:00:51] uat.ERROR: Error retrieving credentials from the instance profile metadata service. (cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html$ [stacktrace] #0 /var/app/current/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php(159): Aws\\Credentials\\InstanceProfileProvider->handleRetryableException(Object(GuzzleHttp\\Exception\\ConnectExceptio$ #1 [internal function]: Aws\\Credentials\\InstanceProfileProvider->Aws\\Credentials\\{closure}() #2 /var/app/current/vendor/guzzlehttp/promises/src/Coroutine.php(160): Generator->throw(Object(GuzzleHttp\\Exception\\ConnectException)) #3 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\\Promise\\Coroutine->_handleFailure(Object(GuzzleHttp\\Exception\\ConnectException)) #4 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\\Promise\\Promise::callHandler(2, Object(GuzzleHttp\\Exception\\ConnectException), NULL) #5 /var/app/current/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\\Promise\\Promise::GuzzleHttp\\Promise\\{closure}() #6 /var/app/current/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(118): GuzzleHttp\\Promise\\TaskQueue->run() #7 /var/app/current/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(145): GuzzleHttp\\Handler\\CurlMultiHandler->tick() #8 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\\Handler\\CurlMultiHandler->execute(true) #9 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\\Promise\\Promise->invokeWaitFn() #10 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\\Promise\\Promise->waitIfPending() #11 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\\Promise\\Promise->invokeWaitList() #12 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending() #13 /var/app/current/vendor/guzzlehttp/promises/src/Coroutine.php(67): GuzzleHttp\\Promise\\Promise->wait() #14 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\\Promise\\Coroutine->GuzzleHttp\\Promise\\{closure}(true) #15 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\\Promise\\Promise->invokeWaitFn() #16 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending() #17 /var/app/current/vendor/guzzlehttp/promises/src/Coroutine.php(103): GuzzleHttp\\Promise\\Promise->wait(false) #18 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(274): GuzzleHttp\\Promise\\Coroutine->wait(false) #19 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\\Promise\\Promise->invokeWaitList() #20 /var/app/current/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\\Promise\\Promise->waitIfPending() #21 /var/app/current/vendor/aws/aws-sdk-php/src/S3/S3Client.php(460): GuzzleHttp\\Promise\\Promise->wait() #22 /var/app/current/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(561): Aws\\S3\\S3Client->createPresignedRequest(Object(Aws\\Command), Object(Illuminate\\Support\\Carbon)) #23 /var/app/current/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(534): Illuminate\\Filesystem\\FilesystemAdapter->getAwsTemporaryUrl(Object(League\\Flysystem\\AwsS3v3\\AwsS3Adap$ #24 /var/app/current/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(399): Illuminate\\Filesystem\\FilesystemAdapter->temporaryUrl('project-name/even...', Object(Illuminate\\Support\\$

@SamRemis
Copy link
Member

SamRemis commented Aug 4, 2021

@mgilberties Thanks :) that's really helpful! I wonder if this issue is releated only to presigned requests. I will be looking into it more once the issue is definitely clear. I did just release tag 3.187.1, so hopefully everyone should have this fixed now.

@SamRemis
Copy link
Member

SamRemis commented Aug 4, 2021

Actually I spoke too soon, it looks like it's taking a bit to update on composer; I'll see what I can do to speed that up.

@SamRemis
Copy link
Member

SamRemis commented Aug 4, 2021

There it goes, should be available now for 3.187.1

@SamRemis
Copy link
Member

SamRemis commented Aug 4, 2021

@mgilberties please confirm this is fixed if you get the chance so I can close this issue out

@mgilberties
Copy link

@SamRemis - I can confirm that we now have v3.187.1 getting picked up and everything is functioning as expected. Thanks for your quick actions and response 🙌

@rootd00d
Copy link

rootd00d commented Aug 4, 2021

Good morning!

I hit this issue this morning after rebuilding a Docker image for MediaWiki --

Aws\Exception\CredentialsException from line 272 of /var/www/html/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php: Error retrieving credentials from the instance profile metadata service. (cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html))
#0 /var/www/html/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php(159): Aws\Credentials\InstanceProfileProvider->handleRetryableException(Object(GuzzleHttp\Exception\ConnectException), Array, 'Error retrievin...')
#1 [internal function]: Aws\Credentials\InstanceProfileProvider->Aws\Credentials\{closure}()
#2 /var/www/html/vendor/guzzlehttp/promises/src/Coroutine.php(160): Generator->throw(Object(GuzzleHttp\Exception\ConnectException))
#3 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Promise\Coroutine->_handleFailure(Object(GuzzleHttp\Exception\ConnectException))
#4 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(2, Object(GuzzleHttp\Exception\ConnectException), NULL)
#5 /var/www/html/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#6 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(118): GuzzleHttp\Promise\TaskQueue->run()
#7 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(145): GuzzleHttp\Handler\CurlMultiHandler->tick()
#8 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#9 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#10 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#11 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#12 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#13 /var/www/html/vendor/guzzlehttp/promises/src/Coroutine.php(67): GuzzleHttp\Promise\Promise->wait()
#14 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\Coroutine->GuzzleHttp\Promise\{closure}(true)
#15 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#16 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#17 /var/www/html/vendor/guzzlehttp/promises/src/Coroutine.php(103): GuzzleHttp\Promise\Promise->wait(false)
#18 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(274): GuzzleHttp\Promise\Coroutine->wait(false)
#19 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#20 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#21 /var/www/html/vendor/aws/aws-sdk-php/src/AwsClientTrait.php(58): GuzzleHttp\Promise\Promise->wait()
#22 /var/www/html/vendor/aws/aws-sdk-php/src/ResultPaginator.php(127): Aws\AwsClient->execute(Object(Aws\Command))
#23 /var/www/html/vendor/aws/aws-sdk-php/src/functions.php(52): Aws\ResultPaginator->valid()
#24 /var/www/html/vendor/aws/aws-sdk-php/src/functions.php(69): Aws\map(Object(Aws\ResultPaginator), Object(Closure))
#25 [internal function]: Aws\flatmap(Object(Aws\ResultPaginator), Object(Closure))
#26 /var/www/html/extensions/AWS/s3/AmazonS3FileBackend.php(550): Generator->valid()
#27 /var/www/html/includes/libs/filebackend/FileBackendStore.php(1105): AmazonS3FileBackend->doDirectoryExists('mediawiki-local...', 'temp/', Array)
#28 /var/www/html/includes/installer/DatabaseUpdater.php(1166): FileBackendStore->directoryExists(Array)
#29 /var/www/html/maintenance/update.php(199): DatabaseUpdater->setFileAccess()
#30 /var/www/html/maintenance/doMaintenance.php(107): UpdateMediaWiki->execute()
#31 /var/www/html/maintenance/update.php(253): require_once('/var/www/html/m...')
#32 {main}

Posting this here in case it helps anyone else. Had me worried there! Super appreciate @massimodellarovere for reporting the issue and the quick fix, @SamRemis. As soon as I saw the release notes I was pretty sure I could revert to an older version, but it's great this has been patched.

@SamRemis
Copy link
Member

SamRemis commented Aug 4, 2021

Great :) this should be working for everyone now, but I'll set this issue to closing soon just to give it a few days if anyone runs into it.

@SamRemis SamRemis added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 4, 2021
@SamRemis SamRemis self-assigned this Aug 4, 2021
@RosiersRobin
Copy link

I'm having the same issue with the latestupdate of the package.

Error retrieving credentials from the instance profile metadata service. (cURL error 7: Failed to connect to 169.254.169.254 port 80: Network unreachable

@SamRemis
Copy link
Member

SamRemis commented Aug 6, 2021

@RosiersRobin you're sure you're using 3.187.3? The error appears to have been fixed. Can you CURL or ping from your machine? The error you're getting also looks different than the one's above

@RosiersRobin
Copy link

@SamRemis Yes, I'm using version 3.187.3

The IP it's willing to go to is that 169.254.169.254 and when I ping it, it won't work, I get PING: transmit failed. General failure.

@SamRemis
Copy link
Member

SamRemis commented Aug 6, 2021

@RosiersRobin can you ping anything at all? And this is a new behavior? To me it looks like an issue with internet settings on your instance, but it was working before and you haven't changed anything?

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 7, 2021
@RosiersRobin
Copy link

RosiersRobin commented Aug 7, 2021

@SamRemis It worked before, now I haven't changed a thing it it doesn't work anymore. When I ping from any other place, same issue occures. When I ping from an remote service like https://www.site24x7.com/ping-test.html it appears to be down too. So I doubt it would have to do with my network.

I have some AWS instances running, when I ping from a server to that IP, then It's tuck at the "sending data" ;

https://i.imgur.com/2PTSWf5.png

@emkcloud
Copy link
Author

emkcloud commented Aug 9, 2021

@RosiersRobin I'm not 100% sure but it seems to me that the IP 169.254.169.254 direction is not reachable via Ping but only via HTTP request for retrieve Metadata. In my instance the ping return timeout no response but if i use CURL is OK

image

@fideloper
Copy link

I hit this issue this morning, running composer update resolved it. Note that the URL it's attempting to hit is http://https//<some-aws-service>.amazonaws.com

There must have been a bug where https// was used instead of https://, although it's hard to scan the commits for a relevant fix.

@electric
Copy link

electric commented Sep 7, 2021

I've just encountered this problem and have been trying to find out exactly why this particular problem affected our code.

@SamRemis are you able to provide some context for the reverted change to help debug the issue?

Thanks

@SamRemis
Copy link
Member

SamRemis commented Sep 7, 2021

@electric it's a bit late where I'm at, but hopefully I'll find time tomorrow to confirm. If I recall correctly, it was exactly what the comment above yours says, a missing colon from the url scheme (https// instead of https://).

Can you set "debug" => true on your client constructor and confirm where the request is being sent?

@SamRemis
Copy link
Member

SamRemis commented Sep 7, 2021

If that's what it is, please try the "composer update" command recommended above. Please let me know if that doesn't work and I'll make sure to get it taken care of ASAP

@electric
Copy link

electric commented Sep 7, 2021

If that's what it is, please try the "composer update" command recommended above. Please let me know if that doesn't work and I'll make sure to get it taken care of ASAP

Thanks Sam - to confirm, a composer update did indeed fix the issue.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants