-
Notifications
You must be signed in to change notification settings - Fork 428
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
Validation error when changing the scheduletype in beat settings #344
Comments
Also now found that when removing an existing beat task from its settings, it wont clear its tasks as well, so it ends up trying to run a task that no longer exists |
Also noticed the first issue you stated when I changed |
Also facing the same ValidationError |
If you are using django as backend framework, update your django-celery-beat to 2.2.0, the latest version. Then you can edit Periodic Task from Admin deleting the old task, you will see this message on your terminal: "DatabaseScheduler: Schedule changed", try it again, it will works! |
closing as per this suggestion. |
We set the schedules from code. Making changes from Django admin if we change something is not really an option. We would need to make manual changes on multiple servers. |
Any Update, facing the same ValidationError |
please provide more concrete info of your problem. and you can always check the code in github and share your thoughts on existing problem |
Problem is here: django-celery-beat/django_celery_beat/schedulers.py Lines 174 to 191 in 5a72e0a
Because It only occurs when you switch |
can you come with a prospective solution? |
Summary:
Whenever you change the schedule type of an existing periodic task and restart, the task will fail validation and raises an error:
django.core.exceptions.ValidationError: {'interval': ['Only one of clocked, interval, crontab, or solar must be set'], 'crontab': ['Only one of clocked, interval, crontab, or solar must be set']}
Exact steps to reproduce the issue:
I have inspected the error and it looks like that the scheduled object now has both an interval and a cron that is set. Haven't had time to look at the sourcecode yet,but i expect that the cleaning isn't behaving as it should when the schedule object already exists in the database but has changed from settings
The text was updated successfully, but these errors were encountered: