barryvdh / laravel-async-queue

Laravel Async Queue Driver
287 stars 76 forks source link

Job status 0 #6

Open Kira69 opened 10 years ago

Kira69 commented 10 years ago

I try to send mail with "Mail::later" and "Queue::Later". It works when I tested in local(with wamp) whereas in my online website, it doesn't work. When I took a look in "laq_async_queue" table", all job have the status 0 ( "start process"). When I add a job in local, they have status 1. Best regards

PS: sorry for my english

barryvdh commented 10 years ago

Maybe you can't run background commands? Any error logs? Make sure your logs etc. are writable, also for the process running the background process. If possible, just use a 'real' queue.

Kira69 commented 10 years ago

In order to execute php artisan, I need to edit the file " Async Queue" and modify the command "php artisan queue:async %d --env=%s " to " php.ORIG.5_4 -n artisan queue:async %d --env=%s " for my web host. When I execute this manually in SSH console, I have this :

[Illuminate\Database\Eloquent\ModelNotFoundException] No query results for model [Barryvdh\Queue\Models\Job].

queue:async job_id

X-Powered-By: PHP/5.4.6 Content-type: text/html

Laravel Log: [2014-07-22 10:35:28] %s.ERROR: exception 'Illuminate\Database\Eloquent\ModelNotFoundException' with message 'No query results for model [Barryvdh\Queue\Models\Job].' in /home/local/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:674 Stack trace:

0 /home/local/vendor/barryvdh/laravel-async-queue/src/Console/AsyncCommand.php(40): Illuminate\Database\Eloquent\Model::findOrFail('%d')

1 /home/local/vendor/laravel/framework/src/Illuminate/Console/Command.php(112): Barryvdh\Queue\Console\AsyncCommand->fire()

2 /home/local/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

3 /home/local/vendor/laravel/framework/src/Illuminate/Console/Command.php(100): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

4 /home/local/vendor/symfony/console/Symfony/Component/Console/Application.php(887): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

5 /home/local/vendor/symfony/console/Symfony/Component/Console/Application.php(193): Symfony\Component\Console\Application->doRunCommand(Object(Barryvdh\Queue\Console\AsyncCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

6 /home/local/vendor/symfony/console/Symfony/Component/Console/Application.php(124): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

7 /home/local/artisan(58): Symfony\Component\Console\Application->run()

8 {main} [] []

natsu90 commented 9 years ago

you do it wrong. it's php.ORIG.5_4 -n artisan queue:async [enter job_id here] --env=local

GrahamCampbell commented 9 years ago

Does https://github.com/barryvdh/laravel-async-queue/commit/77716f98607ff517ffd53b09dd83facb009a4a03 fix this?

barryvdh commented 9 years ago

Or https://github.com/barryvdh/laravel-async-queue/commit/7ed454f0050affa034e5d9f8743009aac76975f3 ?