Description
Symfony version(s) affected:v5.0.5
Description
#laravel/horizon#762
Several of us have been having bizarre issues when using Laravel Horizon to manage our background queues. Since the actual error stems from symfony/console (and there is a comment just above the exception in the source code that says it should never get there) I figured it was best to submit an issue here about it.
How to reproduce
Unfortunately this one is pretty tough to get to the bottom of. So far it seems pretty "random" as to what's causing it. The best lead we have to go down is, throw an exception of any kind during a queued job. Steps to get there are as follows:
- Install fresh copy of laravel v7.2.2 (although version seems to vary)
- Install latest version of laravel horizon (v4.0.2, but again, version seems to vary)
- Create a queued job that throws an exception (a RuntimeException for good measure).
- Run that job loads of times.
- In order to catch the bug, use Bugsnag for bug reporting.
Possible Solution
Tried many things in order to reproduce or fix and so far absolutely nothing has helped.
Additional context
Stack trace:
Symfony\Component\Console\Exception\RuntimeException · Unable to write output.
/home/forge/my.laravel-app.com/vendor/symfony/console/Output/StreamOutput.php:79Symfony\Component\Console\Output\StreamOutput::doWrite
/home/forge/my.laravel-app.com/vendor/symfony/console/Output/Output.php:166Symfony\Component\Console\Output\Output::write
/home/forge/my.laravel-app.com/vendor/symfony/console/Output/Output.php:132Symfony\Component\Console\Output\Output::writeln
/home/forge/my.laravel-app.com/vendor/symfony/console/Style/OutputStyle.php:62Symfony\Component\Console\Style\OutputStyle::writeln
/home/forge/my.laravel-app.com/vendor/symfony/console/Style/SymfonyStyle.php:375Symfony\Component\Console\Style\SymfonyStyle::writeln
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:186Illuminate\Queue\Console\WorkCommand::writeStatus
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:166Illuminate\Queue\Console\WorkCommand::writeOutput
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:143Illuminate\Queue\Console\WorkCommand::Illuminate\Queue\Console\{closure}
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:369Illuminate\Events\Dispatcher::Illuminate\Events\{closure}
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:218Illuminate\Events\Dispatcher::dispatch
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:524Illuminate\Queue\Worker::raiseAfterJobEvent
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:358Illuminate\Queue\Worker::process
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:306Illuminate\Queue\Worker::runJob
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:132Illuminate\Queue\Worker::daemon
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:112Illuminate\Queue\Console\WorkCommand::runWorker
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:96Illuminate\Queue\Console\WorkCommand::handle
/home/forge/my.laravel-app.com/vendor/laravel/horizon/src/Console/WorkCommand.php:46Laravel\Horizon\Console\WorkCommand::handle
[internal]call_user_func_array
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Container/Util.php:36Illuminate\Container\Util::unwrapIfClosure
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:90Illuminate\Container\BoundMethod::callBoundMethod
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:34Illuminate\Container\BoundMethod::call
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:592Illuminate\Container\Container::call
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Console/Command.php:134Illuminate\Console\Command::execute
/home/forge/my.laravel-app.com/vendor/symfony/console/Command/Command.php:255Symfony\Component\Console\Command\Command::run
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Console/Command.php:121Illuminate\Console\Command::run
/home/forge/my.laravel-app.com/vendor/symfony/console/Application.php:912Symfony\Component\Console\Application::doRunCommand
/home/forge/my.laravel-app.com/vendor/symfony/console/Application.php:264Symfony\Component\Console\Application::doRun
/home/forge/my.laravel-app.com/vendor/symfony/console/Application.php:140Symfony\Component\Console\Application::run
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Console/Application.php:93Illuminate\Console\Application::run
/home/forge/my.laravel-app.com/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:130Illuminate\Foundation\Console\Kernel::handle
/home/forge/my.laravel-app.com/artisan:37[main]