SOLVED: Aws-sdk-php error

Hi,

Trying to troubleshoot unrelated issues (unrelated to this error), so i enabled EXPANDED_LOGGING, and now my log is filling with the below error. started to troubelshoot myself, and no idea why my instance of invoiceninja would require aws-sdk-php anyway, but decided not to start “composer remove” things before i bork my install. Please let me know if there is something to be done about this.

    [2021-05-10 19:36:04] production.ERROR: Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) {"exception":"[object] (Aws\\Exception\\CredentialsException(code: 0): Error retrieving credentials from the instance profile metadata service. (cURL error 28: Connection timed out after 1001 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://169.254.169.254/latest/meta-data/iam/security-credentials/) at /var/www/html/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php:242)
[stacktrace]
#0 /var/www/html/vendor/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php(134): Aws\\Credentials\\InstanceProfileProvider->handleRetryableException()
#1 [internal function]: Aws\\Credentials\\InstanceProfileProvider->Aws\\Credentials\\{closure}()
#2 /var/www/html/vendor/guzzlehttp/promises/src/Coroutine.php(160): Generator->throw()
#3 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\\Promise\\Coroutine->_handleFailure()
#4 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\\Promise\\Promise::callHandler()
#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(158): GuzzleHttp\\Promise\\TaskQueue->run()
#7 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(183): GuzzleHttp\\Handler\\CurlMultiHandler->tick()
#8 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\\Handler\\CurlMultiHandler->execute()
#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}()
#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()
#18 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(274): GuzzleHttp\\Promise\\Coroutine->wait()
#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/AwsClientTrait.php(86): Aws\\AwsClient->execute()
#23 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/SqsQueue.php(153): Aws\\AwsClient->__call()
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(327): Illuminate\\Queue\\SqsQueue->pop()
#25 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(336): Illuminate\\Queue\\Worker->Illuminate\\Queue\\{closure}()
#26 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(145): Illuminate\\Queue\\Worker->getNextJob()
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(117): Illuminate\\Queue\\Worker->daemon()
#28 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\\Queue\\Console\\WorkCommand->runWorker()
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#30 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\\Container\\BoundMethod::call()
#34 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\\Container\\Container->call()
#35 /var/www/html/vendor/symfony/console/Command/Command.php(256): Illuminate\\Console\\Command->execute()
#36 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\\Component\\Console\\Command\\Command->run()
#37 /var/www/html/vendor/symfony/console/Application.php(971): Illuminate\\Console\\Command->run()
#38 /var/www/html/vendor/symfony/console/Application.php(290): Symfony\\Component\\Console\\Application->doRunCommand()
#39 /var/www/html/vendor/symfony/console/Application.php(166): Symfony\\Component\\Console\\Application->doRun()
#40 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Symfony\\Component\\Console\\Application->run()
#41 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run()
#42 /var/www/html/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#43 {main}
"}

Hi,

@david any thoughts on this?

I’ve never seen this one before.

The only reason this would be invoked is if the s3 driver is being called somewhere in the code, but i haven’t seen this from local testing myself at all.

So it starts when i try to change the queue from sync to redis. i noticed in config/queue.php the S3 driver is an option, but i’m choosing redis. Can you please let me know the proper way to enable redis (for queues cache and session) and if you even recommend this. ? i’m running latest 5.1.61-release, which was updated from a previous 5.? and migrated from the latest v4 build. I’ll setup a fresh instance of 5.1.61 to see if i can replicate while i wait for a response.

thanks!

I don’t see S3 in the queue.php - I do see sqs however.

I am also using Redis and haven’t seen this one pop up

I’m a fool, tried to follow documentation, and 100% caused this myself. I had setup supservisord to run queue:work, but the example from the laravel docs had “queue:work sqs” which i didn’t notice at the time. Once i fixed my supervisord config, all is working perfectly. @david thanks for making sure i knew that your application is not in fact broken, and getting me to keep looking. I hope if anyone else makes this dumb mistake, they find this thread, and spend less time to resolve than I did.

2 Likes

@hiveint

Thanks for the update, glad you got it resolved :slight_smile:

Had the same issue. Could you elaborate please what was your corrected command line? Was it just example without sqs " queue:work --sleep=3 --tries=3 --max-time=3600"? Thank you.

Thanks, fell for this as well.