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

Keep getting "Bad minute" error, even though cron syntax seems correct #18

Open
remyvanlis opened this issue Feb 2, 2022 · 2 comments

Comments

@remyvanlis
Copy link

remyvanlis commented Feb 2, 2022

Just installed a fresh installation of ubuntu, installed python, npm, pip and JupyterHub, did everything I wanted in the configs and it all just seems to work fine. However, after installing Jupyterlab_scheduler, I noticed it would always throw a "bad minute" error:

traceback: "Traceback (most recent call last):\n File \"/usr/local/lib/python3.9/dist-packages/tornado/web.py\", line 1702, in _execute\n result = method(*self.path_args, **self.path_kwargs)\n File \"/usr/local/lib/python3.9/dist-packages/tornado/web.py\", line 3173, in wrapper\n return method(self, *args, **kwargs)\n File \"/home/amuseic/.local/lib/python3.9/site-packages/jupyterlab_scheduler/handlers.py\", line 119, in post\n job.setall(schedule)\n File \"/home/amuseic/.local/lib/python3.9/site-packages/crontab.py\", line 235, in __exit__\n self.write()\n File \"/home/amuseic/.local/lib/python3.9/site-packages/crontab.py\", line 360, in write\n raise IOError(\"Program Error: {} returned {}: {}\".format(\nOSError: Program Error: /usr/bin/crontab returned 1: **b'\"/tmp/tmpfv9g75nc\":7: bad minute\\nerrors in crontab file, can\\'t install.\\n'\n"**

Even though I'm using copy-pasted syntax from Cron themselves:

image

No idea how to fix this myself, no idea what might be going wrong.

@remyvanlis
Copy link
Author

Noticed something else. The error ends with a statement about a file in /tmp, which contains API calls to 127.0.0.1:8081:

image

But when actually trying to access this on 127.0.0.1:8081, I get a 500 internal server error after logging in. What I've actually hosted it on is 0.0.0.0, in my case 192.168.178.82:8888. This is due to the fact that I access it through nginx with some A records in my hosting service.

image

Could it have anything to do with me changing the default host?

@yangs0459
Copy link

It cased by
JUPYTERHUB_OAUTH_SCOPES="["access:servers!server=abc/", ""]" .

I update file jupyterlab_scheduler/handlers.py around line 118 as below:
`with CronTab(user=os.environ["USER"]) as cron:
for key, value in os.environ.items():
# cron.env[key] = value
try:
cron.env[key] = json.loads(value)
except Exception:
cron.env[key] = value

`

Then restart jupyterhub, it can success add cronjob.

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