Skip to content

Validation error when changing the scheduletype in beat settings #344

@Sult

Description

@Sult

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']}

  • Celery Version: 4.4.2
  • Celery-Beat Version: 2.0.0

Exact steps to reproduce the issue:

  1. setup a beat task with a crontab() schedule
  2. start celery beat and stop it again
  3. change the task to datetime.timedelta(seconds=10)
  4. start beat again

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions