delayed job starts but does not process any jobs in production

3,203 views
Skip to first unread message

Daniel James

unread,
Nov 10, 2011, 7:10:25 PM11/10/11
to delay...@googlegroups.com

I have a rails app using delayed job, it works fine in development however when I pushed to production it doesn't do process any jobs. Delayed job starts up fine using either one of these commands;

RAILS_ENV=production rake jobs:work

or

RAILS_ENV=production script/delayed_job start

However once the process has started it just sits there and does not process any of the jobs that are in the que. I checked the delayed_job.log and it shows that the process starts up fine but does not throw any errors. And for the heck of it I checked the production.log and there are no errors there as well.

Also if I run

RAILS_ENV=production rake jobs:clear

It will delete the jobs that are in the que, so I don't think it has an issue communicating with mongodb.

So I can add jobs to the que and and can delete jobs from the que I just can't get delayed job to process them.

I'm using

Rails 3.1.1
gem 'delayed_job'
gem 'delayed_job_mongoid'

Any insight will be greatly appreciated

Alex Sherstinsky

unread,
Nov 11, 2011, 11:44:06 AM11/11/11
to delay...@googlegroups.com
This is what we use in our capistrano script:
run "cd #{release_path} ; RAILS_ENV=production script/delayed_job stop ; RAILS_ENV=production rake jobs:clear; RAILS_ENV=production script/delayed_job start"

where release_path is the directory in which 'app', 'lib', and 'public' are listed.  Hope this helps.

--Alex

Daniel James

unread,
Nov 11, 2011, 1:14:35 PM11/11/11
to delay...@googlegroups.com
Hey Alex,

Thanks for the reply, once I get the app up and running I will definitely use that line in my capistrano script.  But the problem I am having is that I can't even get the jobs to process anything in the que.  even if I manually run delayed job with the rake task "rake jobs:work".  The jobs just sit in the que and do not get processed, also there are no error messages or anything.  

So to sum up; 

I can add new jobs to the que I can run rake jobs:clear which will clear all jobs, but when there are jobs in the que and i run rake jobs:work DJ does not process anything in the que.

Alex Sherstinsky

unread,
Nov 11, 2011, 3:58:58 PM11/11/11
to delay...@googlegroups.com
Hard to say.  If I was faced with this, I would go into my local copy of the gem (on my Mac it is /Users/shers/.rvm/gems/ruby-1.9.2-p0/gems/delayed_job-2.1.4) and insert debug statements into lib/delayed/worker.rb and others just to make sure that the daemon gets started and runs.  Let me know what this ends up being due to.  Thanks, --Alex

Daniel James

unread,
Nov 15, 2011, 6:29:19 PM11/15/11
to delay...@googlegroups.com
Thanks again for replying, I finally figured it out and it had nothing to do with delayed_job.  It had to do with the ruby gem Anemone that could not authorize the database for some reason.  I patched it though.  Thanks!

Alex Sherstinsky

unread,
Nov 15, 2011, 11:04:59 PM11/15/11
to delay...@googlegroups.com
Great that you figured it out; no way I could!  I am not familiar with Anemone -- can you send me a link with a brief explanation about what it is useful for and why it was blocking delayed_job from normal operation?  Thanks!  --Alex


On Tue, Nov 15, 2011 at 3:29 PM, Daniel James <akada...@gmail.com> wrote:
Thanks again for replying, I finally figured it out and it had nothing to do with delayed_job.  It had to do with the ruby gem Anemone that could not authorize the database for some reason.  I patched it though.  Thanks!

--
Alex Sherstinskyhttp://www.linkedin.com/in/alexsherstinsky

Alexey Skoblikov

unread,
Apr 22, 2013, 9:03:37 AM4/22/13
to delay...@googlegroups.com
How did you figure it out?
I have the same issue with mysql after the hoster has migrated my server to a bigger-memory vps.
Everything works, web-application works, but delayed_job keeps silent, just like yours.
So how were you investigating the problem?


среда, 16 ноября 2011 г., 3:29:19 UTC+4 пользователь Daniel James написал:

namrata mishra

unread,
May 21, 2014, 6:49:36 AM5/21/14
to delay...@googlegroups.com
Even i am facing same issue. Everything is working fine but delayed_jons are silent. Please let me know how did you figured out what is the problem?

Thanks
Namrata

Bráulio Bhavamitra

unread,
Oct 9, 2014, 7:56:13 AM10/9/14
to delay...@googlegroups.com

same here! how did you fix it?

David Genord II

unread,
Oct 9, 2014, 12:22:20 PM10/9/14
to delay...@googlegroups.com
Make sure you are running the latest version of the gems and the most common problem is mixed queue settings

--

---
You received this message because you are subscribed to the Google Groups "delayed_job" group.
To unsubscribe from this group and stop receiving emails from it, send an email to delayed_job...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bráulio Bhavamitra

unread,
Oct 9, 2014, 12:36:42 PM10/9/14
to delay...@googlegroups.com
I figure out that the problem is due to timezones. For some reason
postgresql thinks the run_at is on UTC instead of BRT (-3 GMT). I
trying to see why...
--
"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão
http://cirandas.net/brauliobo
http://eita.org.br

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é
meu lar e todos nós somos cidadãos deste cosmo. Este universo é a
imaginação da Mente Macrocósmica, e todas as entidades estão sendo
criadas, preservadas e destruídas nas fases de extroversão e
introversão do fluxo imaginativo cósmico. No âmbito pessoal, quando
uma pessoa imagina algo em sua mente, naquele momento, essa pessoa é a
única proprietária daquilo que ela imagina, e ninguém mais. Quando um
ser humano criado mentalmente caminha por um milharal também
imaginado, a pessoa imaginada não é a propriedade desse milharal, pois
ele pertence ao indivíduo que o está imaginando. Este universo foi
criado na imaginação de Brahma, a Entidade Suprema, por isso a
propriedade deste universo é de Brahma, e não dos microcosmos que
também foram criados pela imaginação de Brahma. Nenhuma propriedade
deste mundo, mutável ou imutável, pertence a um indivíduo em
particular; tudo é o patrimônio comum de todos."
Restante do texto em
http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia
Reply all
Reply to author
Forward
0 new messages