队列使用报错导致队列重试

laravel 5.5
php 7+
队列去驱动 database

报错信息如下:
[2020-10-16 11:39:28] dev.ERROR: Call to a member function beginTransaction() on null {“exception”:”[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function beginTransaction() on null at /data/html/www/****/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:108)
[stacktrace]

#0 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(92): Illuminate\Database\Connection->createTransaction()

#1 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(23): Illuminate\Database\Connection->beginTransaction()

#2 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(307): Illuminate\Database\Connection->transaction(Object(Closure))

#3 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php(68): Illuminate\Queue\DatabaseQueue->deleteReserved(‘default’, 495)

#4 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(57): Illuminate\Queue\Jobs\DatabaseJob->delete()

#5 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(76): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\DatabaseJob), Array)

#6 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(320): Illuminate\Queue\Jobs\Job->fire()

#7 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(270): Illuminate\Queue\Worker->process(‘database’, Object(Illuminate\Queue\Jobs\DatabaseJob), Object(Illuminate\Queue\WorkerOptions))

#8 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(114): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\DatabaseJob), ‘database’, Object(Illuminate\Queue\WorkerOptions))

#9 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon(‘database’, ‘default’, Object(Illuminate\Queue\WorkerOptions))

#10 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker(‘database’, ‘default’)

#11 [internal function]: Illuminate\Queue\Console\WorkCommand->handle()

#12 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)

#13 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

#14 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))

#15 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)

#16 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)

#17 /data/html/www/WoaapEcrmNew/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

#18 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

#19 /data/html/www/WoaapEcrmNew/vendor/symfony/console/Application.php(987): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

#20 /data/html/www/WoaapEcrmNew/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

#21 /data/html/www/WoaapEcrmNew/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

#22 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Console/Application.php(88): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

#23 /data/html/www/WoaapEcrmNew/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

#24 /data/html/www/WoaapEcrmNew/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

#25 {main}
“}

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 2
JohnYep

问题描述不太清楚

dev.ERROR: Call to a member function beginTransaction() on null
  • 感觉是database配置错误
1周前 评论

这个是没拿到数据库实例吧 然后导致事务的时候发现数据库实例是null

github.com/laravel/framework/pull/...

5天前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!