Hey everyone, I had something scheduled via the Pr...
# ask-community
c
Hey everyone, I had something scheduled via the Prefect CronClock and Scheduled (prefect v0.15.5), and noticed that turning off the schedule on the cloud UI, it still ran at the scheduled time. That's not what I expected to happen, has anyone else experienced this?
a
@chicago-joe I will try to reproduce this and will get back to you
I was trying to reproduce. Here is the flow:
Copy code
import pendulum
from prefect.schedules import Schedule
from prefect.schedules.clocks import CronClock
from prefect import task, Flow


clock = CronClock(
    "*/5 * * * *",
    start_date=pendulum.datetime(2021, 11, 24, 17, 0, tz="Europe/Berlin"),
)
schedule = Schedule(clocks=[clock])

@task(log_stdout=True)
def hw():
    print("Hello world")


with Flow("schedule", schedule=schedule) as flow:
    hw()
As soon as I switched the toggle off, the scheduled runs (yellow bars) got cancelled - see the next image. Can you share more about how you set up the schedule and your agent? The scenario you described shouldn’t happen and I couldn’t reproduce the issue.
c
hmm, one sec I'm grabbing screenshots. Can you try picking a specific time? For example, this is what we used:
Copy code
schedule = Schedule(
        clocks = [
                CronClock("12 15 * * 1-5",
                          start_date = pendulum.now("America/Chicago"),
                          parameter_defaults = {
                                  'sftp_upload':      True,
                                  'sftp_filepath':    '/incoming/',                                                                
                                  'sftp_secret_name': "SFTO_SECRET",
                                   "sftp_encrypt_file":True }),
],)
a
yes, sure I can.
c
a
see the scheduled runs in 1st image. Now as soon as I switch the toggle off, the yellow bar disappears and no flow run got scheduled at 18:02.
c
You're on 0.15.9, we're on 0.15.5. Was hoping you could reproduce with 0.15.5 if possible. The thing is as a professional trading firm, I don't quite have a plan for updating our prefect python versions hand-in-hand with prefect versions, nor do I think we should. Breaking changes would be a real problem that we don't have a solution for just yet. I'm hoping @Kyle Moon-Wright @George Coyne will have a few suggestions when we begin our enterprise contract here in a few weeks 😛
a
sure, let me try to reproduce that with this version. But it can have something to do with parameters, too. Can you share an entire flow definition so that I can reproduce exactly the same setup? What storage and agent did you use here? You could send me your flow via DM, too.
Can you also share your “prefect diagnostics” so that I use the same Python version as well?
@chicago-joe by looking at releases, there were no fixes or breaking changes to schedules since your version.
c
@Anna Geller
$ prefect diagnostics
Copy code
{
  "config_overrides": {},
  "env_vars": [],
  "system_information": {
    "platform": "Linux-5.4.0-90-generic-x86_64-with-glibc2.29",
    "prefect_backend": "cloud",
    "prefect_version": "0.15.5",
    "python_version": "3.8.10"
  }
}
a
thanks, will try to reproduce using the same versions