Unable to create semi-unique webhooks for ipam.prefix and ipam.ipaddress #8223

Closed
opened 2025-12-29 20:33:58 +01:00 by adam · 5 comments
Owner

Originally created by @jonkerj on GitHub (Jun 21, 2023).

NetBox version

v3.5.4

Python version

3.11

Steps to Reproduce

  1. Create (dummy) webhook, name WH1, select ipam.prefix, select creations+updates, http://example.com/foo/bar/, disable SSL verification
  2. Create (dummy) webhook, name WH2, select ipam.ipaddress, select creations+updates, http://example.com/foo/bar/ (same URL as previous), disable SSL verification

Expected Behavior

The second webhook to get created, as it is unique

Observed Behavior

You'll get an error saying Webhook with this URL, Type create, Type update and Type delete already exists.

Originally created by @jonkerj on GitHub (Jun 21, 2023). ### NetBox version v3.5.4 ### Python version 3.11 ### Steps to Reproduce 1. Create (dummy) webhook, name WH1, select ipam.prefix, select creations+updates, http://example.com/foo/bar/, disable SSL verification 2. Create (dummy) webhook, name WH2, select ipam.ipaddress, select creations+updates, http://example.com/foo/bar/ (same URL as previous), disable SSL verification ### Expected Behavior The second webhook to get created, as it is unique ### Observed Behavior You'll get an error saying `Webhook with this URL, Type create, Type update and Type delete already exists.`
adam closed this issue 2025-12-29 20:33:58 +01:00
Author
Owner

@jonkerj commented on GitHub (Jun 21, 2023):

I ran this example through the API as well, using pynetbox, and I've observed this:

  1. WH1 only has ipam.prefix as content_type
  2. WH2 doesn't get created, API 400's with the same error.

I did some grepping in the code, but I could not find relevant matches on this URL or already exists\.; my guess is that this is hidden in some external library.

@jonkerj commented on GitHub (Jun 21, 2023): I ran this example through the API as well, using `pynetbox`, and I've observed this: 1. WH1 only has `ipam.prefix` as `content_type` 2. WH2 doesn't get created, API 400's with the same error. I did some grepping in the code, but I could not find relevant matches on `this URL` or `already exists\.`; my guess is that this is hidden in some external library.
Author
Owner

@abhi1693 commented on GitHub (Jun 21, 2023):

Any reason why you can't use the content types within the same webhook rather than trying to create two nearly identical ones?

@abhi1693 commented on GitHub (Jun 21, 2023): Any reason why you can't use the content types within the same webhook rather than trying to create two nearly identical ones?
Author
Owner

@jonkerj commented on GitHub (Jun 22, 2023):

My actual use case contains a lot more properties, but basically I have different conditions for different objects, in order to reduce the amount of webhooks getting fired. The receiving piece of software is not very efficient and I don't want to "hammer" it with useless triggers.

@jonkerj commented on GitHub (Jun 22, 2023): My actual use case contains a lot more properties, but basically I have different conditions for different objects, in order to reduce the amount of webhooks getting fired. The receiving piece of software is not very efficient and I don't want to "hammer" it with useless triggers.
Author
Owner

@jeremystretch commented on GitHub (Jun 22, 2023):

This is working as expected. The failed validation is a sanity check against duplicate webhooks. If you'd like to propose removing it, please submit a feature request citing your use case.

@jeremystretch commented on GitHub (Jun 22, 2023): This is working as expected. The failed validation is a sanity check against duplicate webhooks. If you'd like to propose removing it, please submit a [feature request](https://github.com/netbox-community/netbox/issues/new?assignees=&labels=type%3A+feature&projects=&template=feature_request.yaml) citing your use case.
Author
Owner

@jonkerj commented on GitHub (Jun 26, 2023):

I can understand that this is working as intended/expected, but the error message is at least misleading, as there is no webhook with (exactly) "this URL, Type create, Type update and Type delete". If it's only the URL that needs to be unique, I'd leave away the types from the message.

I can work around the issue as the receiving end of the webhook requires a keyword in the URL that is not used at all (it is not my software..), so I am putting unqiue dummies there to trick netbox.

@jonkerj commented on GitHub (Jun 26, 2023): I can understand that this is working as intended/expected, but the error message is at least misleading, as there is no webhook with (exactly) "this URL, Type create, Type update and Type delete". If it's only the URL that needs to be unique, I'd leave away the types from the message. I can work around the issue as the receiving end of the webhook requires a keyword in the URL that is not used at all (it is not my software..), so I am putting unqiue dummies there to trick netbox.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8223