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

Laravel 5 Event Queue's #426

Closed
igormatkovic opened this issue Feb 14, 2015 · 8 comments
Closed

Laravel 5 Event Queue's #426

igormatkovic opened this issue Feb 14, 2015 · 8 comments

Comments

@igormatkovic
Copy link

When i try to run a queue worker i get this error:

php artisan queue:work

exception 'MongoException' with message 'zero-length keys are not allowed, did you use $ with double quotes?' in /vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Collection.php:59
Stack trace:
#0 [internal function]: MongoCollection->update(Array, Array, Array)
#1 /vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Collection.php(59): call_user_func_array(Array, Array)
#2 /vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php(679): Jenssegers\Mongodb\Collection->__call('update', Array)
#3 /vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php(679): Jenssegers\Mongodb\Collection->update(Array, Array, Array)
#4 /vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php(436): Jenssegers\Mongodb\Query\Builder->performUpdate(Array, Array)
#5 /vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(181): Jenssegers\Mongodb\Query\Builder->update(Array)
#6 /vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(146): Illuminate\Queue\DatabaseQueue->releaseJobsThatHaveBeenReservedTooLong('default')
#7 /vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\Queue\DatabaseQueue->pop()
#8 /vendor/laravel/framework/src/Illuminate/Queue/Worker.php(150): Illuminate\Queue\Worker->getNextJob(Object(Illuminate\Queue\DatabaseQueue), NULL)
#9 /vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(107): Illuminate\Queue\Worker->pop(NULL, NULL, 0, 3, 0)
#10 /vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(67): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, NULL, 0, 128, false)
#11 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#12 /vendor/laravel/framework/src/Illuminate/Container/Container.php(523): call_user_func_array(Array, Array)
#13 /vendor/laravel/framework/src/Illuminate/Console/Command.php(115): Illuminate\Container\Container->call(Array)
#14 /vendor/symfony/console/Symfony/Component/Console/Command/Command.php(253): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /vendor/laravel/framework/src/Illuminate/Console/Command.php(101): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /vendor/symfony/console/Symfony/Component/Console/Application.php(874): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /vendor/symfony/console/Symfony/Component/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))
#18 /vendor/symfony/console/Symfony/Component/Console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(91): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 {main}

@84564221
Copy link

Can't reproduce this

@igormatkovic
Copy link
Author

@askmatey are you using the queue driver = database ?

@BenoitTalbot
Copy link

hi,
@igormatkovic Do you have to find a solution to your problem?

thx,

@igormatkovic
Copy link
Author

No i have not, switched to beanstalk and its all good

@BenoitTalbot
Copy link

ok thanks, I meet the same problem, I will switch too..

@stephandesouza
Copy link
Contributor

Just an update that I got this bug too

Exception

  [MongoException]
  zero-length keys are not allowed, did you use $ with double quotes?



Exception trace:
 () at /var/www/sys/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Collection.php:42
 MongoCollection->update() at n/a:n/a
 call_user_func_array() at /var/www/sys/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Collection.php:42
 Jenssegers\Mongodb\Collection->__call() at /var/www/sys/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php:763
 Jenssegers\Mongodb\Collection->update() at /var/www/sys/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php:763
 Jenssegers\Mongodb\Query\Builder->performUpdate() at /var/www/sys/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Query/Builder.php:493
 Jenssegers\Mongodb\Query\Builder->update() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php:198
 Illuminate\Queue\DatabaseQueue->releaseJobsThatHaveBeenReservedTooLong() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php:164
 Illuminate\Queue\DatabaseQueue->pop() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:177
 Illuminate\Queue\Worker->getNextJob() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:151
 Illuminate\Queue\Worker->pop() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:109
 Illuminate\Queue\Console\WorkCommand->runWorker() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php:71
 Illuminate\Queue\Console\WorkCommand->fire() at n/a:n/a
 call_user_func_array() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Container/Container.php:502
 Illuminate\Container\Container->call() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Console/Command.php:150
 Illuminate\Console\Command->execute() at /var/www/sys/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Console/Command.php:136
 Illuminate\Console\Command->run() at /var/www/sys/vendor/symfony/console/Application.php:878
 Symfony\Component\Console\Application->doRunCommand() at /var/www/sys/vendor/symfony/console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /var/www/sys/vendor/symfony/console/Application.php:126
 Symfony\Component\Console\Application->run() at /var/www/sys/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:100
 Illuminate\Foundation\Console\Kernel->handle() at /var/www/sys/artisan:36

Here comes the JSON:

 {
   "_id" : ObjectId("55e7b59c9cb7881e178b4568"),
   "queue" : "default",
   "payload" : "{\"job\":\"Illuminate\\\\Events\\\\CallQueuedHandler@call\",\"data\":{\"class\":\"App\\\\Listeners\\\\Me\\\\EmailAddConfirmation\",\"method\":\"handle\",\"data\":\"a:1:{i:0;O:24:\\\"App\\\\Events\\\\Me\\\\EmailAdded\\\":2:{s:4:\\\"user\\\";O:45:\\\"Illuminate\\\\Contracts\\\\Database\\\\ModelIdentifier\\\":2:{s:5:\\\"class\\\";s:14:\\\"App\\\\Model\\\\User\\\";s:2:\\\"id\\\";s:24:\\\"55b072c034a84b2aee4edd55\\\";}s:8:\\\"newEmail\\\";s:28:\\\"stephan@pontocriativo.com.br\\\";}}\"}}",
   "attempts" : NumberLong(0),
   "reserved" : NumberLong(0),
   "reserved_at" : null,
   "available_at" : NumberLong(1441248668),
   "created_at" : NumberLong(1441248668)
}

@jeremy-brenner
Copy link

I'm working on rolling my fix into laravel-mongodb here: https://github.com/jeremy-brenner/laravel-mongodb
I will post here and submit a pull request once it is ready.

@jeremy-brenner
Copy link

Ok, pull request submitted. #623
If you want to pull mine in the meantime in your composer.json change your require:

"jenssegers/mongodb": "dev-master",

and add the repository:

"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:jeremy-brenner/laravel-mongodb.git"
    }
],

You also need to set your QUEUE_DRIVER to "database".

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

6 participants