Custom Job Failing When Scheduled #19602
Unanswered
callieglade
asked this question in
Help Wanted!
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm writing a custom reservation plugin so that when an object is created, the
save()
function creates a background job which changes the object's status from Active to Inactive at the reservation's end date. I've written my jobs based on this doc, and it creates the job, but when the job executes at the scheduled time, it errors out withAttributeError("'NoneType' object has no attribute 'status'")
. I'm also unable to get a stack trace of this error from logs, and unable to find the setting that I need to change this.Using nbshell to test this further, I found the job executes accurately when ran with
MyJob.enqueue(immediate=True)
, but produces the error above when executed withMyJob.enqueue(schedule_at=datetime)
. This is with Netbox v4.2.7, running in Docker container v3.2.0.The part of my code to enqueue the script is in this block in
models.py
:The job being executed from
jobs.py
:Beta Was this translation helpful? Give feedback.
All reactions