framework icon indicating copy to clipboard operation
framework copied to clipboard

Iron.io queues

Open conarwelsh opened this issue 13 years ago • 12 comments

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...')

/**

  • Contact Page Submission */ Route::post('contact', array( 'as' => 'contact.submit', function() { $data = array( 'name' => Input::get('name'), 'email' => Input::get('email'), 'content' => Input::get('message') );

    /**
     * User Email
     */
    Mail::queue(array('emails.contact.user_html', 'emails.contact.user_text'), $data, function($m) use($data)
    {
        $m->to($data['email'], $data['name'])->subject('Thank you for contacting us!');
    });
    
    /**
     * System Email
     */
    Mail::queue(array('emails.contact.system_html', 'emails.contact.system_text'), $data, function($m) use($data)
    {
        $m->to('[email protected]', Tester')->subject('Someone filled out the Contact Form');
    });
    

    return 'OK'; // return Redirect::route('contact')->with('success', 'Thank you for contacting us! Your email has been sent!'); } ));

conarwelsh avatar Apr 25 '13 20:04 conarwelsh

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

dcrystalj avatar Apr 28 '13 09:04 dcrystalj

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

taylorotwell avatar Apr 29 '13 19:04 taylorotwell

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

dcrystalj avatar Apr 29 '13 20:04 dcrystalj

Hey @conarwelsh still seeing issues here?

carimura avatar Apr 29 '13 20:04 carimura

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

conarwelsh avatar Apr 29 '13 20:04 conarwelsh

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?

DanSmith70 avatar May 02 '13 12:05 DanSmith70

Paste your code

On May 2, 2013, at 7:04 AM, Daniel Smith [email protected] 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.

taylorotwell avatar May 02 '13 12:05 taylorotwell

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} [] []

DanSmith70 avatar May 02 '13 12:05 DanSmith70

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

taylorotwell avatar May 02 '13 12:05 taylorotwell

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!

DanSmith70 avatar May 02 '13 12:05 DanSmith70

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

carimura avatar May 02 '13 17:05 carimura

@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.

taylorotwell avatar May 02 '13 18:05 taylorotwell