We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Successful execution of the job
2022-05-18 08:47:08,148: ERROR/ForkPoolWorker-6] Task nautobot.extras.jobs.scheduled_job_handler[9c03a139-3dba-4a10-bc1b-fd1881600613] raised unexpected: KeyError('scheduled_job_pk') Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 451, in trace_task R = retval = fun(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/celery/app/trace.py", line 734, in __protected_call__ return self.run(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/nautobot/extras/jobs.py", line 1203, in scheduled_job_handler scheduled_job_pk = kwargs.pop("scheduled_job_pk") KeyError: 'scheduled_job_pk'
nautobot/extras/views.py has the following:
scheduled_job = ScheduledJob( name=schedule_name, task="nautobot.extras.jobs.scheduled_job_handler", job_class=job_model.class_path, job_model=job_model, start_time=schedule_datetime, description=f"Nautobot job {schedule_name} scheduled by {request.user} for {schedule_datetime}", kwargs=job_kwargs, interval=schedule_type, one_off=schedule_type == JobExecutionType.TYPE_FUTURE, user=request.user, approval_required=job_model.approval_required, ) scheduled_job.kwargs["scheduled_job_pk"] = scheduled_job.pk scheduled_job.save()
while nautobot/extras/api/views.py has the following:
scheduled_job = ScheduledJob( name=name, task="nautobot.extras.jobs.scheduled_job_handler", job_class=job.class_path, job_model=job_model, start_time=time, description=f"Nautobot job {name} scheduled by {request.user} on {time}", kwargs=job_kwargs, interval=type_, one_off=(type_ == JobExecutionType.TYPE_FUTURE), user=request.user, approval_required=job_model.approval_required, ) scheduled_job.save()
It appears that the API view is failing to set the scheduled_job_pk on the kwargs when compared to the UI view.
scheduled_job_pk
kwargs
The text was updated successfully, but these errors were encountered:
Thanks @glennmatthews to raise this issue. Any idea in which release would be fixed?
Sorry, something went wrong.
Add entry for #1787 to changelog
53b972f
gsnider2195
Successfully merging a pull request may close this issue.
Environment
Steps to Reproduce
Expected Behavior
Successful execution of the job
Observed Behavior
Analysis
nautobot/extras/views.py has the following:
while nautobot/extras/api/views.py has the following:
It appears that the API view is failing to set the
scheduled_job_pk
on thekwargs
when compared to the UI view.The text was updated successfully, but these errors were encountered: