与oracle连接时,Laravel队列工作不处理作业

8tntrjer  于 2023-02-21  发布在  Oracle
关注(0)|答案(1)|浏览(172)

我的laravel项目与oracle数据库连接,当我执行命令php artisan queue:work时,作业未执行,并且日志中出现此错误

[stacktrace]
#0 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\HandleExceptions.php(266): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'Array to string...', 'C:\\\\laragon\\\\www\\\\...', 32)
#1 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\Stringable.php(32): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}(2, 'Array to string...', 'C:\\\\laragon\\\\www\\\\...', 32)
#2 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Support\\Str.php(68): Illuminate\\Support\\Stringable->__construct(Array)
#3 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\DatabaseQueue.php(261): Illuminate\\Support\\Str::of(Array)
#4 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\DatabaseQueue.php(239): Illuminate\\Queue\\DatabaseQueue->getLockForPopping()
#5 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\DatabaseQueue.php(224): Illuminate\\Queue\\DatabaseQueue->getNextAvailableJob('default')
#6 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Concerns\\ManagesTransactions.php(30): Illuminate\\Queue\\DatabaseQueue->Illuminate\\Queue\\{closure}(Object(Yajra\\Oci8\\Oci8Connection))
#7 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\DatabaseQueue.php(227): Illuminate\\Database\\Connection->transaction(Object(Closure))
#8 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(342): Illuminate\\Queue\\DatabaseQueue->pop('default')
#9 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(351): Illuminate\\Queue\\Worker->Illuminate\\Queue\\{closure}('default')
#10 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Worker.php(160): Illuminate\\Queue\\Worker->getNextJob(Object(Illuminate\\Queue\\DatabaseQueue), 'default')
#11 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Console\\WorkCommand.php(147): Illuminate\\Queue\\Worker->daemon('database', 'default', Object(Illuminate\\Queue\\WorkerOptions))
#12 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Queue\\Console\\WorkCommand.php(130): Illuminate\\Queue\\Console\\WorkCommand->runWorker('database', 'default')
#13 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(36): Illuminate\\Queue\\Console\\WorkCommand->handle()
#14 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#15 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#16 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#17 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(661): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#18 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Console\\Command.php(183): Illuminate\\Container\\Container->call(Array)
#19 C:\\laragon\\www\\emt\\vendor\\symfony\\console\\Command\\Command.php(312): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#20 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Console\\Command.php(153): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#21 C:\\laragon\\www\\emt\\vendor\\symfony\\console\\Application.php(1022): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#22 C:\\laragon\\www\\emt\\vendor\\symfony\\console\\Application.php(314): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Queue\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#23 C:\\laragon\\www\\emt\\vendor\\symfony\\console\\Application.php(168): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#24 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Console\\Application.php(102): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#25 C:\\laragon\\www\\emt\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(155): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#26 C:\\laragon\\www\\emt\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#27 {main}
"} ```

如果使用mysql连接项目,则命令将成功执行

nimxete2

nimxete21#

我解决了这个问题。在我追踪问题的位置并发现它无法在framework\src\Illuminate\Queue\DatabaseQueue.php(261)文件Str::of($databaseVersion)中获取数据库版本值之后,我在config/oracel. php文件'version' => env('DB_SERVER_VERSION', '11g'),中添加了以下行
然后工作就成功了

相关问题