Post to /api/ipam/prefixes/<int:pk>/available-ips/ is slow when the prefix is large #8740

Closed
opened 2025-12-29 20:40:39 +01:00 by adam · 1 comment
Owner

Originally created by @tobiasge on GitHub (Oct 12, 2023).

Originally assigned to: @tobiasge on GitHub.

NetBox version

v3.6.3

Python version

3.11

Steps to Reproduce

  1. Create large prefix (e. g. 10.0.0.0/8)
  2. Request an IP from the created prefix with:
    curl -v -X POST -d '{}' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Token REDACTED' http://localhost:8787/api/ipam/prefixes/$idOfPrefixFromStep1/available-ips/

Expected Behavior

Get a fast response

Observed Behavior

Response takes over 30 seconds

Originally created by @tobiasge on GitHub (Oct 12, 2023). Originally assigned to: @tobiasge on GitHub. ### NetBox version v3.6.3 ### Python version 3.11 ### Steps to Reproduce 1. Create large prefix (e. g. 10.0.0.0/8) 2. Request an IP from the created prefix with: curl -v -X POST -d '{}' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Authorization: Token REDACTED' http://localhost:8787/api/ipam/prefixes/$idOfPrefixFromStep1/available-ips/ ### Expected Behavior Get a fast response ### Observed Behavior Response takes over 30 seconds
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:40:39 +01:00
adam closed this issue 2025-12-29 20:40:39 +01:00
Author
Owner

@tobiasge commented on GitHub (Oct 12, 2023):

I think the bug is caused by the missing limit parameter for get_available_objects in AvailableObjectsView.post in netbox/ipam/api/views.py

@tobiasge commented on GitHub (Oct 12, 2023): I think the bug is caused by the missing limit parameter for `get_available_objects` in `AvailableObjectsView.post` in `netbox/ipam/api/views.py`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8740