Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Show cronjobs" displays error schedule #16

Open
suevii opened this issue Dec 29, 2021 · 1 comment
Open

"Show cronjobs" displays error schedule #16

suevii opened this issue Dec 29, 2021 · 1 comment

Comments

@suevii
Copy link

suevii commented Dec 29, 2021

Hi,

Environment

Jupyterlab version: 3.0.6

Description

I found this issue when I click the "Show cronjobs" button.
image

Reproduce steps

The issue is randomly occured, to reproduce it:

  1. add several jobs
  2. delete some of them

Workaround

I found it was caused by the missing of blank line between the job and the previous variables in the system crontab file:
截屏2021-12-29 上午10 18 30

If I try to add a blank line, the issue is fixed.
截屏2021-12-29 上午10 28 07

I think there may be some bug when calling the /delete api (which delete some extra blank lines) or the regex pattern matching the schedule (but when I test the pattern outside the jupyterlab, it seems correct).
My current solution is to change the regex pattern matching the schedule in the get /list API:
schedule_match = re.search(r"(((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7}", str(job))
schedule = schedule_match.group(0)
instead of above code:
schedule = str(job.slices)

With this fix the issue is gone, but I'm not sure it causes other issue.
Please comment if anything wrong, thank you.😊

@jovanni-hernandez
Copy link
Member

Thanks for reporting this bug and doing some digging to find the root cause - I'll try to get this implemented soon. I also ran into a new bug recently where that regexp doesn't work when the OS reinterprets the CRON strings as @daily @Weekly, etc, so it needs some tweaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants