laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.45k stars 11k forks source link

Iron.io queues #1079

Closed conarwelsh closed 11 years ago

conarwelsh commented 11 years ago

When using the ironmq (specifically on iron.io) the attempted delete call it continually comes back with "Message not found" into the log files. This causes whatever the queued task was to continually re-run itself, until it runs our of retries.

/vendor/iron-io/iron_core/IronCore.class.php(252): IronCore->reportHttpError(404, '{"msg":"Message...') /vendor/iron-io/iron_core/IronCore.class.php(226): IronCore->callWithRetries() /vendor/iron-io/iron_mq/IronMQ.class.php(337): IronCore->apiCall('DELETE', 'projects/517954...') /vendor/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php(66): IronMQ->deleteMessage('queue_name', 'xxxxxxxx...')

/**

dcrystalj commented 11 years ago

well i have problems to. I run artisan queue:listen but no queue really get from iron.io, so no mail is sent :weary:

taylorotwell commented 11 years ago

Are you using push queues when you get this error? If so, I believe this should be fixed.

dcrystalj commented 11 years ago

i switched from windows to ubuntu and this thing started to work =)

carimura commented 11 years ago

Hey @conarwelsh still seeing issues here?

conarwelsh commented 11 years ago

@taylorotwell yea it was push queues, and it looks like you nailed it thanks! @carimura yea seems to be good, just tested it.

DanSmith70 commented 11 years ago

I'm having this exact same problem, laravel is up to date as of today but still getting this error. @taylorotwell was the problem on Iron's side, or could there have been a regression in Laravel?

taylorotwell commented 11 years ago

Paste your code

On May 2, 2013, at 7:04 AM, Daniel Smith notifications@github.com wrote:

I'm having this exact same problem, laravel is up to date as of today but still getting this error. @taylorotwell was the problem on Iron's side, or could there have been a regression in Laravel?

— Reply to this email directly or view it on GitHub.

DanSmith70 commented 11 years ago

I should say I'm not using Mail::queue sorry, just a vanilla Queue::push(), but the result is the same. My job is very standard:

  public function fire($job, $data)
    {

        // Code I can't make public sorry :( but trust me it doesnt interact with $job in any way

        $job->delete();
    }

The job is pushed to the queue just fine, executes with out error but once $job->delete is called, I get this stack trace:

[2013-05-02 11:59:43] log.ERROR: exception 'Http_Exception' with message 'http error: 404 | {"msg":"Message not found"}' in /var/www/releases/20130502110129/app/services/libraries/iron-io/iron_core/IronCore.class.php:260
Stack trace:
#0 /var/www/releases/20130502110129/app/services/libraries/iron-io/iron_core/IronCore.class.php(252): IronCore->reportHttpError(404, '{"msg":"Message...')
#1 /var/www/releases/20130502110129/app/services/libraries/iron-io/iron_core/IronCore.class.php(226): IronCore->callWithRetries()
#2 /var/www/releases/20130502110129/app/services/libraries/iron-io/iron_mq/IronMQ.class.php(337): IronCore->apiCall('DELETE', 'projects/517686...')
#3 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php(66): IronMQ->deleteMessage('ayima-tools-liv...', '587334961817403...')
#4 /var/www/releases/20130502110129/app/services/queuehandlers/HandleHeaderCheck.php(47): Illuminate\Queue\Jobs\IronJob->delete()
#5 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(60): HandleHeaderCheck->fire(Object(Illuminate\Queue\Jobs\IronJob), Array)
#6 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Queue/Jobs/IronJob.php(56): Illuminate\Queue\Jobs\Job->resolveAndFire(Array)
#7 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Queue/IronQueue.php(102): Illuminate\Queue\Jobs\IronJob->fire()
#8 [internal function]: Illuminate\Queue\IronQueue->marshal()
#9 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(128): call_user_func_array(Array, Array)
#10 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(163): Illuminate\Queue\QueueManager->__call('marshal', Array)
#11 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(163): Illuminate\Queue\QueueManager->marshal()
#12 /var/www/releases/20130502110129/app/routes.php(58): Illuminate\Support\Facades\Facade::__callStatic('marshal', Array)
#13 /var/www/releases/20130502110129/app/routes.php(58): Illuminate\Support\Facades\Queue::marshal()
#14 [internal function]: {closure}()
#15 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Routing/Route.php(80): call_user_func_array(Object(Closure), Array)
#16 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Routing/Route.php(47): Illuminate\Routing\Route->callCallable()
#17 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Routing/Router.php(969): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#18 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(490): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#19 /var/www/releases/20130502110129/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(473): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#20 /var/www/releases/20130502110129/public/index.php(49): Illuminate\Foundation\Application->run()
#21 {main} [] []
taylorotwell commented 11 years ago

If you're using a "push queue" there is no need to delete the job.

DanSmith70 commented 11 years ago

Ah :( I was going from your screencast where you called it. I just switched it to

try { $job->delete(); } catch (\Exception $e) {} which you use in Mail::queue() and it seems to be working now!

carimura commented 11 years ago

Hey @taylorotwell (or anyone) let me know if we need additional documentation somewhere.....

taylorotwell commented 11 years ago

@carimura thanks! i think this one is just on our end. I just need to document that push queue jobs don't need to be "deleted", as well as probably just make those job's delete methods a no-op.