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

if use default queue listener always throw exceptions #9555

Closed
jason-chang opened this issue Jul 7, 2015 · 7 comments
Closed

if use default queue listener always throw exceptions #9555

jason-chang opened this issue Jul 7, 2015 · 7 comments

Comments

@jason-chang
Copy link

commnd:
php artisan queue:listen

exception:

   [ErrorException]
   Undefined index: job


[2015-07-08 00:01:17] local.ERROR: exception 'ErrorException' with message 'Undefined index: job' in /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php:125

Stack trace:
#0 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(125): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined index...', '/mnt/hgfs/web/i...', 125, Array)
#1 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Jobs/RedisJob.php(50): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#2 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(202): Illuminate\Queue\Jobs\RedisJob->fire()
#3 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(153): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), '0', '0')
#4 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(109): Illuminate\Queue\Worker->pop(NULL, 'default', '0', '3', '0')
#5 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(71): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, 'default', '0', '128', false)
#6 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#7 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Container/Container.php(502): call_user_func_array(Array, Array)
#8 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Console/Command.php(149): Illuminate\Container\Container->call(Array)
#9 /mnt/hgfs/web/icd/vendor/symfony/console/Command/Command.php(259): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Console/Command.php(135): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /mnt/hgfs/web/icd/vendor/symfony/console/Application.php(878): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /mnt/hgfs/web/icd/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /mnt/hgfs/web/icd/vendor/symfony/console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /mnt/hgfs/web/icd/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(98): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /mnt/hgfs/web/icd/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 {main}

@GrahamCampbell
Copy link
Member

Probably due to a conflict with your cache.

@GrahamCampbell
Copy link
Member

You need to connect to a different redis database.

@jason-chang
Copy link
Author

redis-cli
127.0.0.1:6379> KEYS *

  1. "queues:default:delayed"
    127.0.0.1:6379>

and Mailer:queue() can send a email

sorry my english is so bad.

@GrahamCampbell
Copy link
Member

You're probably best asking on the forums.

@jason-chang
Copy link
Author

GrahamCampbell thank you.

i'll ask this on StackOverflow.
and is there a better forum? what is it.

and if i try to debug this how do i start? xdebug?

thanks

@cabloo
Copy link

cabloo commented Jan 1, 2016

For other people who come across this problem: I had the same issue after I forgot to add the 'Illuminate\Queue\SerializesModels' to a Job/Command class. Earlier in the Job/Command pipeline, the json_encode function doesn't know how to serialize Jobs that have models without that function, so json_encode on the array containing the job returns false.

@slothentic
Copy link

If you have a job class that does not use implements ShouldQueue it will return this error

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

4 participants