You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
goes to vendor/laravel/framework/src/Illuminate/Queue/Worker.php:285
protected function stopWorkerIfLostConnection($e)
{
if ($this->causedByLostConnection($e)) {
$this->shouldQuit = true;
}
}
goes to vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php:16
trait DetectsLostConnections
{
/**
* Determine if the given exception was caused by a lost connection.
*
* @param \Exception $e
* @return bool
*/
protected function causedByLostConnection(Exception $e)
{
which yields a failure:
[2017-06-13 11:32:49] test.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Illuminate\Queue\Worker::causedByLostConnection() must be an instance of Exception, instance of Error given, called in /opt/test-processor/vendor/laravel/framework/src/Illuminate/Queue/Worker.php on line 287 in /opt/test-processor/vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php:16
Stack trace:
#0 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(287): Illuminate\Queue\Worker->causedByLostConnection(Object(Error))
#1 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(252): Illuminate\Queue\Worker->stopWorkerIfLostConnection(Object(Error))
#2 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(104): Illuminate\Queue\Worker->getNextJob(Object(ClearanceJobs\Queue\SqsBatchQueue), 'test-batch-q...')
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "a7b63af1c266cac15784360fab5c05f3",
"packages": [
{
"name": "aws/aws-sdk-php",
"version": "3.29.3",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "f375f08b77da1a1dbf68e4a0384d65e7d9018639"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f375f08b77da1a1dbf68e4a0384d65e7d9018639",
"reference": "f375f08b77da1a1dbf68e4a0384d65e7d9018639",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^5.3.1|^6.2.1",
"guzzlehttp/promises": "~1.0",
"guzzlehttp/psr7": "^1.4.1",
"mtdowling/jmespath.php": "~2.2",
"php": ">=5.5"
},
"require-dev": {
"andrewsville/php-token-reflection": "^1.4",
"aws/aws-php-sns-message-validator": "~1.0",
"behat/behat": "~3.0",
"doctrine/cache": "~1.4",
"ext-dom": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
"ext-spl": "*",
"nette/neon": "^2.3",
"phpunit/phpunit": "^4.8.35|^5.4.0",
"psr/cache": "^1.0"
/laravel
#3 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('sqs', 'test-batch-q...', Object(Illuminate\Queue\WorkerOptions))
#4 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(84): Illuminate\Queue\Console\WorkCommand->runWorker('sqs', 'test-batch-q...')
#5 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#6 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#7 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#9 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#10 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): Illuminate\Container\Container->call(Array)
#11 /opt/test-processor/vendor/symfony/console/Command/Command.php(264): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#12 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#13 /opt/test-processor/vendor/symfony/console/Application.php(869): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /opt/test-processor/vendor/symfony/console/Application.php(223): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /opt/test-processor/vendor/symfony/console/Application.php(130): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /opt/test-processor/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /opt/test-processor/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 {main}
The text was updated successfully, but these errors were encountered:
The fix seems to be just taking the type out of the function signature, and optionally checking that $e is one of those two types before trying to read $e->getMessage();
Description:
I have an SQS Queue Worker that is getting an unknown connection problem during getNextJob() and yielding a Throwable.
vendor/laravel/framework/src/Illuminate/Queue/Worker.php:249
goes to vendor/laravel/framework/src/Illuminate/Queue/Worker.php:285
goes to vendor/laravel/framework/src/Illuminate/Database/DetectsLostConnections.php:16
which yields a failure:
The text was updated successfully, but these errors were encountered: