A cancelled run can end as Errored after committing its changes
Maintainers usually reply within 1 day
@pheus is already working on this.
Since Oct 23, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start by tracing the cutover cancellation path, scheduler queueing, and the existing cancellation and completion notification handling for Custom Script Jobs. Reproduce the timing race with the listed NetBox and plugin versions, then verify that a successfully committed run ends as Completed without a duplicate notification error and that the owner receives the appropriate notification.
Written by the indexing model from the issue text.
Description
Plugin Version
v0.0.1
NetBox Version
v4.7.1
Python Version
3.12
Steps to Reproduce
- With notifications at their default setting, schedule a built-in Custom Script under Customization > Scripts to run a few minutes ahead.
- Under Scripts > Migration, run inventory and Stage Projects, then wait for valid revisions.
- Select Enter cutover so cancellation overlaps the scheduler queueing the due run. This timing race allows the cancelled run to execute.
Expected Behavior
If the Script has executed successfully and committed its changes, its Job ends as Completed. An existing cancellation notification should not turn the completed run into an error.
Observed Behavior
The Script commits its changes, but its Job ends as Errored with:
duplicate key value violates unique constraint "extras_notification_unique_per_object_and_user"
Cutover has already notified the owner about cancellation. Creating a completion notification for the same Job and user violates the uniqueness constraint, leaving the owner with only the cancellation notice.
- Dominant language
- Python
- Stars
- 8
- Forks
- 0
- Avg merge
- 9h 56m
- Merged PRs (30d)
- 29
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from netbox-community/netbox-scripts
-
Run links keep only the last value of repeated query parametersPossibly taken @pheus claimed this 1 day ago. Openapp: scripts severity: medium status: accepted type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
netbox-community/netbox-scripts#83 · 1 assignee ·
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
netbox-community/netbox-scripts#80 ·
Maintainers usually reply within 1 day
-
Cleanup confirmation treats retained Job history as a blockerPossibly taken @pheus claimed this 1 day ago. Openapp: scripts severity: medium status: accepted type: bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
netbox-community/netbox-scripts#79 · 1 assignee ·
Maintainers usually reply within 1 day
-
Failed REST uploads expose internal error detailsPossibly taken @pheus claimed this 1 day ago. Openapp: scripts severity: medium status: accepted type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
netbox-community/netbox-scripts#77 · 1 assignee ·
Maintainers usually reply within 1 day
-
app: scripts severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
netbox-community/netbox-scripts#76 ·
Maintainers usually reply within 1 day
All issues in netbox-community/netbox-scripts
Similar issues
-
bug module:nodes tests
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rocketride-org/rocketride-server#3020 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
bretterer/home-assistant-rivian#335 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mampfes/hacs_waste_collection_schedule#8114 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TIGER-AI-Lab/ClawBench#475 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
UKGovernmentBEIS/inspect_ai#6322 ·
Maintainers usually reply within 1 day