Hey team - I had a flow run kick off unexpectedly ...
# prefect-community
b
Hey team - I had a flow run kick off unexpectedly (Cron
10 15 * * 1-5
and kicked off on a Saturday). How can I debug this? More details inside
1
This is the schedule I have set
and this was the flow run that was kciked off
Am I doing something wrong here or is there somewhere to see the “trigger” for this flow run ?
I’m thinking possibly I originally scheduled this for every day, and then updated my deployment, and maybe the already scheduled tasks didn’t get removed?
(though I can still see incorrectly scheduler flows runs next weekend)
a
Can you try doing a hard refresh of your browser tab with command shift R? often it's just UI cache/display issue
you could try inspecting the work-queue from the CLI to validate this on the backend side
b
sure thing
thanks Anna - the process definitely ran though on the agent
Okay, hard refresh still shows the scheduled flows next weekend
a
thx for confirming that. I also can't understand why. Would you be open to creating a GitHub issue? I will try to reproduce and add my example there. It could be a Cron schedule bug
b
absolutely
a
adding your prefect version and agent setup would be helpful as well
thanks so much Brad and thanks for reporting this
this is definitely not a client-side issue since CronSchedule is valid and properly skips weekends:
Copy code
import asyncio
from prefect.orion.schemas.schedules import CronSchedule


async def validate_schedule():
    schedule = CronSchedule(cron="10 15 * * 1-5", timezone="America/New_York")
    response = await schedule.get_dates(12)
    for dt in response:
        print(dt)


if __name__ == "__main__":
    asyncio.run(validate_schedule())
2022-08-22T151000-04:00 2022-08-23T151000-04:00 2022-08-24T151000-04:00 2022-08-25T151000-04:00 2022-08-26T151000-04:00 2022-08-29T151000-04:00 2022-08-30T151000-04:00 2022-08-31T151000-04:00 2022-09-01T151000-04:00 2022-09-02T151000-04:00 2022-09-05T151000-04:00 2022-09-06T151000-04:00
b
Okay interesting - I’ll have to file the issue later today
but I’ll try and create an MRE beforehand - I think it might be to do with re-registering the same flow with a different schedule
🙏 1
@Anna Geller one more thing - does a
prefect work-queue inspect
show me the next scheduled flow runs ?
is that the best way to test the scheduled flow runs
a
you can select the time period with --hours flag I think
b
ah, its actually
preview
?
a
yup
b
yep nice ty!
I’ll come back with an issue + MRE
🙌 1
🙏 1
a
I was trying to reproduce on 2.1.1 and I couldn't find any issue - weekends are properly skipped - note that the time in CLI is displayed in UTC for me
b
hmmmmmmm okay
a
perhaps it's worth to just remove the deployment, upgrade Prefect and recreate the deployment?
b
yep +1
a
not sure what went wrong, but it shouldn't have happened 🙈
b
I’ll do that to start and see how it goes
🙌 1
thanks so much for your time!
a
for you, anytime Brad!
👏 1
b
Okay @Anna Geller just confirming a bump of prefect and recreating the deployment has fixed it ..
🙌 2
🙏 1
a
thanks for the update!
h
Trying to get the hang of prefect 2 for future transition, however I have the following issues After running the file a had a runtime error:”” “Orion requires sqlite>=3.24.0 but we found version 3.22.0” Secondly how can I effect schedule from local file/environment?
a
@Hedgar this thread has been closed. If you have any questions, could you start a new thread? thanks a lot! this helps us keep things clean