In Laravel 6 , after the queue task fails, the exception information is not written to the table failed_jobs
1. When a queue task fails, the failed method is cleaned after the task fails. Throw an exception and find something related to TeleScope
[2023-11-20 17:25:42] local.ERROR: file_get_contents(E:\wwwroot\object\storage\app\theme_downloads\2023\11\20\1700472319.9435.1423840798\migrations\migrate_settings_data.php): failed to open stream: No such file or directory {
"exception": "[object] (ErrorException(code: 0): file_get_contents(E:\\wwwroot\\wshop\\platform\\storage\\app\\theme_downloads\\2023\\11\\20\\1700472319.9435.1423840798\\migrations\\migrate_settings_data.php): failed to open stream: No such file or directory at E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\telescope\\src\\ExceptionContext.php:45)
[stacktrace]
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'file_get_conten...', 'E:\\\\wwwroot\\\\wsho...', 45, Array)
#1 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\telescope\\src\\ExceptionContext.php(45): file_get_contents('E:\\\\wwwroot\\\\wsho...')
#2 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\telescope\\src\\ExceptionContext.php(19): Laravel\\Telescope\\ExceptionContext::getFileContext(Object(ErrorException))
#3 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\telescope\\src\\Watchers\\JobWatcher.php(108): Laravel\\Telescope\\ExceptionContext::get(Object(ErrorException))
#4 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Events\\Dispatcher.php(369): Laravel\\Telescope\\Watchers\\JobWatcher->recordFailedJob(Object(Illuminate\\Queue\\Events\\JobFailed))
#5 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Events\\Dispatcher.php(218): Illuminate\\Events\\Dispatcher->Illuminate\\Events\\{closure}('Illuminate\\\\Queu...', Array)
#6 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Jobs\\Job.php(185): Illuminate\\Events\\Dispatcher->dispatch('Illuminate\\\\Queu...')
#7 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(482): Illuminate\\Queue\\Jobs\\Job->fail(Object(ErrorException))
#8 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(469): Illuminate\\Queue\\Worker->failJob(Object(Illuminate\\Queue\\Jobs\\RedisJob), Object(ErrorException))
#9 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(399): Illuminate\\Queue\\Worker->markJobAsFailedIfWillExceedMaxAttempts('redis', Object(Illuminate\\Queue\\Jobs\\RedisJob), 1, Object(ErrorException))
#10 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(372): Illuminate\\Queue\\Worker->handleJobException('redis', Object(Illuminate\\Queue\\Jobs\\RedisJob), Object(Illuminate\\Queue\\WorkerOptions), Object(ErrorException))
#11 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(314): Illuminate\\Queue\\Worker->process('redis', Object(Illuminate\\Queue\\Jobs\\RedisJob), Object(Illuminate\\Queue\\WorkerOptions))
#12 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(134): Illuminate\\Queue\\Worker->runJob(Object(Illuminate\\Queue\\Jobs\\RedisJob), 'redis', Object(Illuminate\\Queue\\WorkerOptions))
#13 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Console\\WorkCommand.php(112): Illuminate\\Queue\\Worker->daemon('redis', 'default', Object(Illuminate\\Queue\\WorkerOptions))
#14 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Console\\WorkCommand.php(96): Illuminate\\Queue\\Console\\WorkCommand->runWorker('redis', 'default')
#15 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#16 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Util.php(37): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#17 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#18 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#19 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(590): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#20 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Console\\Command.php(134): Illuminate\\Container\\Container->call(Array)
#21 E:\\wwwroot\\wshop\\platform\\vendor\\symfony\\console\\Command\\Command.php(255): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#22 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Console\\Command.php(121): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#23 E:\\wwwroot\\wshop\\platform\\vendor\\symfony\\console\\Application.php(1021): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#24 E:\\wwwroot\\wshop\\platform\\vendor\\symfony\\console\\Application.php(275): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Queue\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#25 E:\\wwwroot\\wshop\\platform\\vendor\\symfony\\console\\Application.php(149): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#26 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Console\\Application.php(93): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#27 E:\\wwwroot\\wshop\\platform\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(131): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#28 E:\\wwwroot\\wshop\\platform\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#29 {main}
"
}
2. Use the queue:work artisan command to run the processor, and find that the queue task has not ended and has not failed. as shown in Figure 1
PS E:\wwwroot\object> php artisan queue:work
[2023-11-20 17:25:19][4kBhJcMDrWBEuf8ZWskA9ikQlGbu9kBL] Processing: Modules\ThemeStoreDb\Jobs\InstallThemeToDb
3. Check the table failed_jobs, and there is no new record added. as shown in Figure 2
4. In the .env file, disable TeleScope, and execute the queue task again, and a new record has been successfully added to the table failed_jobs. as shown in Figure 3
TELESCOPE_ENABLED=false
5. Restore step 4. The root cause should be caused by the execution of the view::addLocation($this->location); method, and the method view::flushFinderCache() is also executed. Then the directory $this->location is deleted. Decided to no longer delete the directory $this->location. Run the processor with the Queue:work Artisan command and find that the queue task has failed. And in the table failed_jobs, new records have also been added. as shown in Figure 4



