Job scheduler stopped working

My job scheduler stopped working randomly last night at 12am. After that time, all jobs are not running anymore.

I tried re-enabling the job-scheduler but that is not working. Also bench migrate does not help and re-abling the server script job does also not work. The jobs are scheduled in ‘scheduled job type’ but just not running.

How do I fix this?

1 Like

Hi @mrPauwHaan

Tried bench scheduler resume ?

Anyway, I’ve faced something like that weeks ago and finally reinstalled the site restoring backup because I was unable to know what was happening … :sweat_smile: version-15?

Thanks for your quick response! I tried that but it also did not work. It is indeed in the latest version.

For an unknown reason it started working again and the scheduler runs fine now. I have still no clue what causes this issue but it happens regularly that the scheduler has its own plans

1 Like

:joy: Scheduler is the rebel teenager!

1 Like

Login out and login back in has helped me before :man_shrugging:

2 Likes

Hi @gtapias:

Thanks, I will try if this happen again!
I suspect that REDIS is involved somehow here, but …

@gtapias:

Didn’t wait too long … :upside_down_face:
Today, suddenly, scheduler stops on one site …

After logout/login, it starts again …
Ay, qué cosas!

It’s the little imperfections that make you perfect in my eyes.

:sweat_smile:

Hi again @gtapias:

I think I found the reason for that …

If the system detects no interactive activity (mean manual login) in the site for the last x days (defined on system settings) and you are not in developer_mode (since v15.38.0) … jobs will get “dormant” status … and, theorically, it will run just daily. I think something like this is happening. This is the reason why it restarts after logout/login

And finally … check this:

Maybe bench clear-cache could help too in some cases.

Oh, wow! Thank you, @avc

We have about 40 users, still goes dormant once in a while, meaning logins and logouts combinations for 40 users still probable enough to not have activity for that number of days. Increasing to 30 in my production system (unless there is a good reason not to do so).

Renaming that section to make it even more clear that we are talking about days and not number of workers would help.

Background Workers Inactivity Days

Reduce job runs frequency to once per day after the above number of inactive days.

Again, tooltips would be of great use here to add detail (separate rant :sweat_smile:).

Indeed, in activity log the last user logged in 4 days ago. Since logins are handled by a social login this is not always seen as a login/logout and causes issues with this 4-day scheduler rule. I just changed the amount of days from 4 to 365 to fix it.

1 Like