workless icon indicating copy to clipboard operation
workless copied to clipboard

not running delayed jobs on heroku staging server after deploy new changes

Open kashiftufail opened this issue 12 years ago • 18 comments

Hi,

i'm using workless with delayed_job_active_record. these are in my gem file gem 'rails','3.2.11' gem 'delayed_job_active_record' gem "workless", "~> 1.1.1" gem 'heroku'

my staging server is running on heroku here is url http://gentle-gorge-9319.herokuapp.com/

when i deployed code with new changes workless not fired jobs from delayed job table.

i have this code in my production.rb

                   config.after_initialize do
                      Delayed::Job.scaler = :heroku
                  end

and this as well also not work for me

                 config.after_initialize do
                      Delayed::Job.scaler = :heroku_cedar
                  end

installed gems version on heroku

                       Using delayed_job (3.0.5)
                       Using delayed_job_active_record (0.4.1)
                       Using workless(1.1.2)

Any help?

Thanks

kashiftufail avatar Feb 22 '13 17:02 kashiftufail

+1 having the same issue. Working great locally, but not on my heroku app on cedar. Tried both of the above as well

travisdahl avatar Mar 25 '13 06:03 travisdahl

have you on your heroku dynos and workers on setting page of your heroku app?

kashiftufail avatar Mar 25 '13 09:03 kashiftufail

What is the output of the heroku config command for that app (you can censor out secret information)

Have you followed the installation instructions? I've missed setting the APP_NAME, and than workless didn't work...

davidakachaos avatar Mar 25 '13 12:03 davidakachaos

I have followed all the installation instructions and APP_NAME is set correctly. @kashiftufail may be correct though. I dont have a worker added in my heroku settings because when I add it, it says it will be $35/mo and thats what I was trying to avoid by using this gem. I guess I am still unclear how it works, do i need to add 1 worker initially in heroku settings and then workless will scale it back down to 0 when its not being used? And thank you guys for your quick responses, much appreciated!!

travisdahl avatar Mar 25 '13 14:03 travisdahl

UPDATE: Yup, I added one worker and agreed to the terms then tried again and it worked. And then I went back into my settings and console and saw that workless then shut down the worker and it was back at 0. Excellent! Sorry for my lack of understanding. You guys rock

travisdahl avatar Mar 25 '13 14:03 travisdahl

No problem! Good to know that you must first agree to the conditions before you can even use a worker (didn't know that) but glad this issues was resolved for you!

davidakachaos avatar Mar 25 '13 14:03 davidakachaos

I am having a similar issue. I added a worker on the Heroku dashboard, and this caused the jobs to fire, and the workers were set back to 0 when finished. However, any subsequent jobs did not fire. I was not presented with any terms to agree to either.

jettblue avatar May 31 '13 22:05 jettblue

Is this still unresolved?

lostboy avatar Aug 19 '13 12:08 lostboy

Is i need to turn on heroku dyno with workless?

Later on i remove this gem from my gem file and turn on heroku dyno.

kashiftufail avatar Aug 19 '13 13:08 kashiftufail

@kashiftufail i'm not sure what you're asking, can you rephrase?

lostboy avatar Aug 22 '13 19:08 lostboy

I am having a similar issue where the heroku workers are not being scaled from zero to one when a new job is added. Would changing the default size of a worker in the Heroku console to 2X cause an issue?

warnickr avatar Sep 04 '13 18:09 warnickr

Hey guys I'm having the same problem and tried what travisdahl did (enabling 1 additional worker in heroku dashboard) but after running the job successfully the additional worker is still there.

Gemfile content:

gem 'delayed_job_active_record' gem 'daemons' gem 'workless'

Production.rb content:

config.after_initialize do Delayed::Job.scaler = :heroku_cedar end

Thanks :) alfredo

ascoppa avatar Oct 03 '13 01:10 ascoppa

Quick questions:

  • Have you setup the workless required ENV variables?
  • Does the log of the application show a notice about workless related errors or that it should have done something?

Thanks for you input!

davidakachaos avatar Oct 03 '13 08:10 davidakachaos

I'm having this issue, too. One day it was working, then one day it wasn't...

My Gemfile hasn't been touched and I haven't changed any code pertaining to workers and delayed_jobs.

taylorbrooks avatar Oct 29 '13 14:10 taylorbrooks

What versión of workless are you using? In my case downgrading did the trick.

Sent from my iPhone

On 29/10/2013, at 11:14, Taylor Brooks [email protected] wrote:

I'm having this issue, too. One day it was working, then one day it wasn't...

My Gemfile hasn't been touched and I haven't changed any code pertaining to workers and delayed_jobs.

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

ascoppa avatar Oct 29 '13 19:10 ascoppa

Actually... I just realized that when you change your Heroku password, your HEROKU_API_KEY changes as well.

I reset my ENV variable and workless started working again.

taylorbrooks avatar Oct 30 '13 04:10 taylorbrooks

@lostboy and @taylorbrooks I have forked workless and mitigate the aforementioned issue sending a notification to Rollbar when a Heroku api-key or app-name is invalid. This is done through a begin-rescue yielding. In this way I'm at least noticed when something strange occurs, e.g. when the api-key is changed due to a password reset.

r4m avatar May 07 '14 13:05 r4m

For some forgotten or unknown (to me at least) reason my heroku api-key had changed - and that is what had caused workless to stop working. Resetting the HEROKU_API_KEY as suggested worked for me.

charlesdeb avatar Jul 28 '14 16:07 charlesdeb