We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I have a bug on PHP 7.3 installed Yii2 Advanced , i installed yii2-queue with composer,
in Backend and common config /console i have the following config in place :
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'bootstrap' => [ 'queue', ], 'components' => [ 'cache' => [ 'class' => \yii\caching\FileCache::class, ], 'queue' => [ 'class' => \yii\queue\file\Queue::class, 'path' => '@common/runtime/queue', 'as log' => \yii\queue\LogBehavior::class ], ],
in one backend controller i have defined :
class Email22Job extends BaseObject implements \yii\queue\JobInterface { public $to; public function execute($queue) { echo 'something'; } }
and i run it from the same controller
Yii::$app->queue->push( new Email22Job());
all good but when i do from the backend yii queue/listen i get :
[11] unknown job (attempt: 1, PID: 696) is finished with error: yii\queue\InvalidJobException: Job must be a JobInterface instance instead of __PHP_Incomplete_Class#1 ( [__PHP_Incomplete_Class_Name] => 'backend\controllers\Email22Job' [to] => null ). in /var/www/vendor/yiisoft/yii2-queue/src/Queue.php:277 Stack trace: #0 /var/www/vendor/yiisoft/yii2-queue/src/Queue.php(230): yii\queue\Queue->unserializeMessage('O:30:"backend\c...') #1 /var/www/vendor/yiisoft/yii2-queue/src/cli/Queue.php(162): yii\queue\Queue->handleMessage('11', 'O:30:"backend\c...', '300', '1') #2 /var/www/vendor/yiisoft/yii2-queue/src/cli/Command.php(146): yii\queue\cli\Queue->execute('11', 'O:30:"backend\c...', '300', '1', '696') #3 [internal function]: yii\queue\cli\Command->actionExec('11', '300', '1', '696') #4 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) #5 /var/www/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array) #6 /var/wwwvendor/yiisoft/yii2/console/Controller.php(179): yii\base\Controller->runAction('exec', Array) #7 /var/www/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('exec', Array) #8 /var/www/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('queue/exec', Array) #9 /var/www/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('queue/exec', Array) #10 /var/www/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request)) #11 /var/www/backend/yii(27): yii\base\Application->run() #12 {main}.
Any idea ? Thank you
The text was updated successfully, but these errors were encountered:
Thank you for your question. In order for this issue tracker to be effective, it should only contain bug reports and feature requests.
We advise you to use our community driven resources:
If you are confident that there is a bug in the framework, feel free to provide information on how to reproduce it. This issue will be closed for now.
This is an automated comment, triggered by adding the label question.
question
Sorry, something went wrong.
The 'console.php' should be have a same alias config with the web.php,like:
web.php
'aliases' => [ '@micro' => __DIR__, ],
No branches or pull requests
Hello,
I have a bug on PHP 7.3 installed Yii2 Advanced , i installed yii2-queue with composer,
in Backend and common config /console i have the following config in place :
in one backend controller i have defined :
class Email22Job extends BaseObject implements \yii\queue\JobInterface
{
public $to;
public function execute($queue)
{
echo 'something';
}
}
and i run it from the same controller
Yii::$app->queue->push( new Email22Job());
all good but when i do from the backend yii queue/listen i get :
[11] unknown job (attempt: 1, PID: 696) is finished with error: yii\queue\InvalidJobException: Job must be a JobInterface instance instead of __PHP_Incomplete_Class#1
(
[__PHP_Incomplete_Class_Name] => 'backend\controllers\Email22Job'
[to] => null
). in /var/www/vendor/yiisoft/yii2-queue/src/Queue.php:277
Stack trace:
#0 /var/www/vendor/yiisoft/yii2-queue/src/Queue.php(230): yii\queue\Queue->unserializeMessage('O:30:"backend\c...')
#1 /var/www/vendor/yiisoft/yii2-queue/src/cli/Queue.php(162): yii\queue\Queue->handleMessage('11', 'O:30:"backend\c...', '300', '1')
#2 /var/www/vendor/yiisoft/yii2-queue/src/cli/Command.php(146): yii\queue\cli\Queue->execute('11', 'O:30:"backend\c...', '300', '1', '696')
#3 [internal function]: yii\queue\cli\Command->actionExec('11', '300', '1', '696')
#4 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#5 /var/www/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#6 /var/wwwvendor/yiisoft/yii2/console/Controller.php(179): yii\base\Controller->runAction('exec', Array)
#7 /var/www/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('exec', Array)
#8 /var/www/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('queue/exec', Array)
#9 /var/www/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('queue/exec', Array)
#10 /var/www/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#11 /var/www/backend/yii(27): yii\base\Application->run()
#12 {main}.
Any idea ? Thank you
The text was updated successfully, but these errors were encountered: