No entry point exists to mark a background job as failed #11339

Closed
opened 2025-12-29 21:43:51 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jul 2, 2025).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.3.3

Python Version

3.10

Steps to Reproduce

This issue concerns the current implementation of JobRunner, specifically the way the run() method of a job is executed:

ea4c205a37/netbox/netbox/jobs.py (L77-L79)

Expected Behavior

Setting the status of a job to "failed" (STATUS_FAILED) within the run() method should mark the completed job as failed.

Observed Behavior

The job's status is overwritten with the default "completed" status so long as no exceptions are raised within run(). This is because the terminate() method, called immediately after run(), sets the job's status to "completed" by default.

Originally created by @jeremystretch on GitHub (Jul 2, 2025). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.3.3 ### Python Version 3.10 ### Steps to Reproduce This issue concerns the current implementation of JobRunner, specifically the way the `run()` method of a job is executed: https://github.com/netbox-community/netbox/blob/ea4c205a37baa3e58e6e481158c15c6154cceeff/netbox/netbox/jobs.py#L77-L79 ### Expected Behavior Setting the status of a job to "failed" (`STATUS_FAILED`) within the `run()` method should mark the completed job as failed. ### Observed Behavior The job's status is overwritten with the default "completed" status so long as no exceptions are raised within `run()`. This is because the `terminate()` method, called immediately after `run()`, sets the job's status to "completed" by default.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 21:43:51 +01:00
adam closed this issue 2025-12-29 21:43:51 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11339