Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Transaction Error on Laravel Queue Runner #42503

Closed
sayemk opened this issue May 25, 2022 · 2 comments
Closed

Database Transaction Error on Laravel Queue Runner #42503

sayemk opened this issue May 25, 2022 · 2 comments

Comments

@sayemk
Copy link

sayemk commented May 25, 2022

  • Laravel Version: 6.20.43
  • PHP Version: 7.3.18
  • Database Driver & Version: Aurora MySQL 5.7

Description:

prod.ERROR: There is already an active transaction {"exception":"[object] (PDOException(code: 0): There is already an active transaction at /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php:133)
[stacktrace]
#0 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(133): PDO->beginTransaction()
#1 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(115): Illuminate\Database\Connection->createTransaction()
#2 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(23): Illuminate\Database\Connection->beginTransaction()
#3 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(203): Illuminate\Database\Connection->transaction(Object(Closure))
#4 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(284): Illuminate\Queue\DatabaseQueue->pop('default')
#5 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(123): Illuminate\Queue\Worker->getNextJob(Object(Illuminate\Queue\DatabaseQueue), 'default')
#6 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(112): Illuminate\Queue\Worker->daemon('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#7 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(96): Illuminate\Queue\Console\WorkCommand->runWorker('database', 'default')
#8 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#9 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#10 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#11 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#12 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#13 /usr/share/nginx/html/nautilus-report/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call(Array)
#14 /usr/share/nginx/html/nautilus-report/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#15 /usr/share/nginx/html/nautilus-report/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))
#16 /usr/share/nginx/html/nautilus-report/vendor/symfony/console/Application.php(1009): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /usr/share/nginx/html/nautilus-report/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /usr/share/nginx/html/nautilus-report/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /usr/share/nginx/html/nautilus-report/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))

Steps To Reproduce:

Run the Queue as a Daemon and in the meantime if the DB driver gets an error or restart or connection is lost before committing then this error occurs.

FYI

I am running the queue in supervisor with one process and the command is artisan queue:work database --sleep=5 --tries=2

@driesvints
Copy link
Member

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out.

Thanks!

@sayemk
Copy link
Author

sayemk commented May 26, 2022

Is there any LTS version I can upgrade to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants