Cable length cannot exceed 32767 units #2553

Closed
opened 2025-12-29 18:19:54 +01:00 by adam · 1 comment
Owner

Originally created by @johanreinalda on GitHub (Apr 25, 2019).

Environment

  • Python version: 3.6.6
  • NetBox version: 2.5.10 or 2.5.11-dev

Adding cables (thank you, great feature!), the cable length cannot exceed 32767 units.

Steps to Reproduce

  1. add cable with proper connection points
    2.set length > 32767

Expected Behavior

We would like to be able to set lengths up to 120,000 or so. We use Netbox to document our fiber plant for the university. We have some fiber runs to remote sites that are up to 110km (optical long-haul transceivers without amplification). This is a 'would be nice' feature. This can be solved by adding the 'km' unit, but for more details, it would be nice to document the actual length more accurately in "m" (or "ft" for shorter runs around town that still go beyond 32767 ft)

Observed Behavior

The input is limited to max value 32768 right in html field value. Hence you cannot submit.
<input type="number" name="length" value="32768" min="0" class="form-control" placeholder="Length" id="id_length">

Note sure if this requires changed in datatypes in the database, but thank you for considering this!

Originally created by @johanreinalda on GitHub (Apr 25, 2019). ### Environment * Python version: 3.6.6 * NetBox version: 2.5.10 or 2.5.11-dev Adding cables (thank you, great feature!), the cable length cannot exceed 32767 units. ### Steps to Reproduce 1. add cable with proper connection points 2.set length > 32767 ### Expected Behavior We would like to be able to set lengths up to 120,000 or so. We use Netbox to document our fiber plant for the university. We have some fiber runs to remote sites that are up to 110km (optical long-haul transceivers without amplification). This is a 'would be nice' feature. This can be solved by adding the 'km' unit, but for more details, it would be nice to document the actual length more accurately in "m" (or "ft" for shorter runs around town that still go beyond 32767 ft) ### Observed Behavior The input is limited to max value 32768 right in html field value. Hence you cannot submit. &lt;input type="number" name="length" value="32768" min="0" class="form-control" placeholder="Length" id="id_length"&gt; Note sure if this requires changed in datatypes in the database, but thank you for considering this!
adam closed this issue 2025-12-29 18:19:54 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 25, 2019):

Cables are intended to model local connections within a site. Long-haul circuits are better represented as, well, circuits.

FYI the 32767 limit is a characteristic of the database field: 32767 is the maximum value of a signed 16-bit integer. (I'm not clear on why Django forces a signed integer for a PositiveSmallIntegerField; something to do with compatibility across other databases, I believe.)

@jeremystretch commented on GitHub (Apr 25, 2019): Cables are intended to model local connections within a site. Long-haul circuits are better represented as, well, circuits. FYI the 32767 limit is a characteristic of the database field: 32767 is the maximum value of a signed 16-bit integer. (I'm not clear on why Django forces a signed integer for a PositiveSmallIntegerField; something to do with compatibility across other databases, I believe.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2553