Skip to content

Webhooks sent despite protection rule block #15090

@ryankearney

Description

@ryankearney

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.10

Steps to Reproduce

  1. Create a webhook that triggers on an IP Address delete
  2. Create a custom protection rule that will block deletion if IP addresses. For example: { "ipam.ipaddress": [ { "status": { "eq": "deprecated" } } ] }
  3. Go delete an IP address object that does not satisfy the protection rule
  4. Observe the error message Deletion is prevented by a protection rule: {'status': ['Ensure this value is equal to deprecated.']} (this is expected)
  5. Observe the webhook firing for an ipaddress deletion (this is unexpected)

Expected Behavior

Webhook should not fire on deletion if a protection rule prevented the deletion from happening.

Observed Behavior

Webhook is sent sent with event deleted and a snapshot.postchange value of null despite the system blocking this deletion. This could have implications on webhook receivers processing the deletion when in fact the object remains in NetBox.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtopic: event rulesFor issues related to the Event Rules featuretype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions