Duplicate Webhooks Being Generated #12044
Replies: 2 comments 4 replies
-
In the admin panel under background tasks. If you are expecting a bulk edit of multiple interfaces to only generate one we hook request, that is indeed a wrong assumption. One webhook request will be generated for each individual object that is edited. |
Beta Was this translation helpful? Give feedback.
-
There is a log of past webhooks visible under (User) > Admin > System:Background Tasks > Finished Jobs. Then at least you can see how many webhook requests were created and delivered - click on the count to see the individual jobs. Or maybe some were rejected by Jenkins; there's a separate count for Failed Jobs. What do you mean "at once"? Do you mean that you are hitting the REST API with multiple requests for the same device concurrently? This isn't a great idea in general, because Netbox's Django model validation cannot enforce consistency between two overlapping transactions (except in cases where the validation is done by the database's own referential integrity). For example, you can get Netbox to allocate duplicate IP addresses this way. EDIT: having said this: if you are making separate updates to distinct interfaces then there probably shouldn't be a problem, since these are separate objects. If you perform a single bulk update operation (where you supply a single PATCH payload with a JSON list of interfaces to update) then I think it should be safe. Writing a Custom Script which does all its work within one transaction should also be safe - you must remember to take a snapshot of each object for change logging, but I don't know if that's required for webhooks too. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a general workflow I've been testing that goes something like this:
I've been playing with it so I can work out potential bugs, and one thing I've found is NetBox seems to send an inconsistent number of webhooks. For example, if I update 4 interfaces on a device at once, Jenkins will end up creating 8 jobs...or 5 jobs, or 6. If I update just one interface, one job is created as expected. I'm curious if there's a way to verify that this is a problem with NetBox? Is there a log of past webhooks somewhere?
Beta Was this translation helpful? Give feedback.
All reactions