Scheduled task not running

Continuing the discussion from Scheduled background tasks not running:

Looks like I’m having the same issue. Since transitioning to the new beta python custom libraries.

I have two task that have never ran. They are on my master branch, and I do have scheduled task turned on for my production application. (I also have had these task for quite some time and they ran in the past.)

Thanks!

After reading your post, I immediately checked an app that I switched to beta 3.10 just two weeks ago, and my background tasks are still running.

1 Like

Hmmm, so that’s definitely not the driving reason.

Thank you for verifying!

Well…
Your app may have something that tickles the scheduling engine the wrong way, well… a way different from mine.

I just thought I would just add a little info to the cause.

1 Like

Hi @anthonys,

We’ve seen Scheduled Tasks stop running after a configuration update occasionally before, and we’re investigating. In the meantime, un-ticking and re-ticking “Run scheduled tasks in this environment” should get them working again!

2 Likes

Hi @daviesian, unfortunately the turn off/on method didn’t work for me :face_holding_back_tears:

Any other debug methods I could attempt?

Bumping this in hopes to get more suggestions to test!

1 Like

I noticed an issue with my scheduled task not running recently also. When I looked into it on Monday, it hadn’t run for a while. But then it did run, so I just shrugged and didn’t think more of it. (My app is infrequently used so whether the scheduled task runs typically doesn’t affect anything.) But looking back just now, I see it only ran twice on Monday and then stopped again. Oddly, the Scheduled Tasks pane says it has never been run:

It’s on Full Python 3, as it has been for years. Looking back in the logs, I can see Sept. 15 is when it stopped running on its prescribed hourly schedule, the last run being 6:53:56 CDT. When I look at my Version History for that day, it shows “Created LICENSE.txt” at 7:16 CDT, which probably marks when I created a GitHub repo for it?

1 Like

The “un-ticking and re-ticking” method worked for me when I finally tried it yesterday evening.

If you have an app that’s currently configured for scheduled tasks and not running them, could you shoot an email with the app ID to support@anvil.works, and an indication of which things/branches we can play with? This is particularly annoying to debug, as it’s an intermittent issue that works in testing and sometimes goes away on its own during testing, so it’s really difficult to pin down, and a few bites of the apple would be really handy at this stage!

I think I realized what triggers it for me:

My scheduled task is set on an environment using the ‘published’ branch. I use ‘master’ as the development branch and then when I’m read to release, I switch to the ‘published’ branch and right-click the new commit, selecting “Reset published branch to commit.” I think it’s when I “move” the ‘published’ branch like that that the scheduled task stops (until I go and unclick and click the “Run scheduled tasks in this environment” box again).

3 Likes

Ahaaaaa! Thank you, that gives us a massive lead to go on! :male_detective:

3 Likes

It looks like that clue did something :eyes: … All my scheduled task ran this morning. The only oddity being some were ran in MST vs UTC time.

Hi everyone,

Thanks very much for your patience while we worked on this. We finally found the issue, and it was related to the Github integration - any apps connected to Github were likely to see their scheduled tasks failing, especially if they were under active development. The fix for this is now deployed, so unticking and reticking “Run scheduled tasks in this environment” one final time should get your scheduled tasks running reliably again for any apps where this has been a problem.

Please let us know if you still have any problems after re-enabling your scheduled tasks.

3 Likes