php – Argument 2 passed to Pheanstalk\Job::__construct() must be of the type string, null given-ThrowExceptions

Exception or error:

I’m running a Laravel application and using Beanstalkd and "pda/pheanstalk": "^4.0" for my queue and it works perfectly. However, after a few hours, my jobs start crashing and it throws this crash and when I do php artisan queue:restart it starts working again. There is nothing specific about my code or application in these logs. Has anyone encountered this situation before?

Argument 2 passed to Pheanstalk\Job::__construct() must be of the type string, null given, called in /var/www/api/vendor/pda/pheanstalk/src/Pheanstalk.php on line 278 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 2 passed to Pheanstalk\\Job::__construct() must be of the type string, null given, called in /var/www/api/vendor/pda/pheanstalk/src/Pheanstalk.php on line 278 at /var/www/api/vendor/pda/pheanstalk/src/Job.php:30)
[stacktrace]
#0 /var/www/api/vendor/pda/pheanstalk/src/Pheanstalk.php(278): Pheanstalk\\Job->__construct(1, NULL)
#1 /var/www/api/vendor/laravel/framework/src/Illuminate/Queue/BeanstalkdQueue.php(129): Pheanstalk\\Pheanstalk->reserveWithTimeout(0)
#2 /var/www/api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(253): Illuminate\\Queue\\BeanstalkdQueue->pop('express')
#3 /var/www/api/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(107): Illuminate\\Queue\\Worker->getNextJob(Object(Illuminate\\Queue\\BeanstalkdQueue), 'express')
#4 /var/www/api/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): Illuminate\\Queue\\Worker->daemon('beanstalkd', 'express,listing...', Object(Illuminate\\Queue\\WorkerOptions))
#5 /var/www/api/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): Illuminate\\Queue\\Console\\WorkCommand->runWorker('beanstalkd', 'express,listing...')
#6 [internal function]: Illuminate\\Queue\\Console\\WorkCommand->handle()
#7 /var/www/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#8 /var/www/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#9 /var/www/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#10 /var/www/api/vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#11 /var/www/api/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call(Array)
#12 /var/www/api/vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#13 /var/www/api/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))
#14 /var/www/api/vendor/symfony/console/Application.php(915): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#15 /var/www/api/vendor/symfony/console/Application.php(272): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Queue\\Console\\WorkCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#16 /var/www/api/vendor/symfony/console/Application.php(148): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#17 /var/www/api/vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#18 /var/www/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(133): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#19 /var/www/api/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#20 {main}
"}
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *