Committed `runcustomscript` runs do not deliver Event Rule actions

Open Beginner friendly
#152 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@pheus is already working on this.

Since Nov 11, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by locating where runcustomscript constructs NetBoxFakeRequest, then trace how NetBox copies that request for Event Rule actions. Check the command's tests and add coverage for a committed script that triggers an Event Rule. Done means the command succeeds and the matching action is queued, as described in the reproduction steps.

Written by the indexing model from the issue text.

Description

app: scripts Bucket: KTLO severity: medium status: accepted type: bug
Plugin Version

v0.0.1

NetBox Version

v4.7.4

Python Version

3.12

Steps to Reproduce
  1. Create a Webhook and an enabled Event Rule that triggers it when a Tag is created.
  2. Upload and activate a Project containing deploy.py:
    from extras.models import Tag
    from netbox_scripts import Script
    
    
    class MakeTag(Script):
        def run(self, data, commit):
            Tag.objects.create(name='From Revision', slug='from-revision')
            self.log_success('The tag was created.')
    
  3. Run the Script from the command line:
    python netbox/manage.py runcustomscript deploy.MakeTag --commit
    
  4. Check the command output, Job status, and Webhook receiver.
Expected Behavior

The Tag is created, the command completes successfully, and the matching Webhook is queued for delivery, as it is when the Script runs through the UI or REST API.

Observed Behavior

The Tag is created, but the Webhook is not queued. The command exits with an error, and the Job is marked as failed:

[error] The Script did not finish: 'NetBoxFakeRequest' object has no attribute 'path_info'

An Event Rule configured to run a Script from this plugin is also affected. The triggered Script is not queued, and NetBox logs Error processing event rule with the same AttributeError.

The runcustomscript command constructs a NetBoxFakeRequest without path_info, which NetBox requires when copying the request for an Event Rule action.

This is related to #122, but separate: #122 concerns the Job's failure message, whereas this issue prevents the Event Rule action from being queued.

Dominant language
Python
Stars
8
Forks
0
Avg merge
12h 34m
Merged PRs (30d)
57

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from netbox-community/netbox-scripts

All issues in netbox-community/netbox-scripts

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.