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

问题描述 投票:0回答:1

我的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连接项目,命令执行成功

laravel oracle laravel-8 oci8
1个回答
0
投票

我解决 经过我追踪到问题的位置,发现在framework\src\Illuminate\Queue\DatabaseQueue.php(261)文件中获取数据库版本值失败

Str::of($databaseVersion)
我在 config/oracel.php 文件中添加了以下行
'version' => env('DB_SERVER_VERSION', '11g'),

然后工作成功了

© www.soinside.com 2019 - 2024. All rights reserved.