Creating an IP (via bulk import or API) assigned to a device without specifying interface creates inconsistency #8384

Closed
opened 2025-12-29 20:36:04 +01:00 by adam · 2 comments
Owner

Originally created by @aldem on GitHub (Jul 30, 2023).

NetBox version

v3.5.7

Python version

3.11

Steps to Reproduce

  1. Create any device (or choose existing one) for testing
  2. Do a bulk IP import or use API to create an IP assigned to a device without specifying an interface, like this (bulk import):
address,status,device
11.22.33.44/32,active,example.dev
  1. Try to open device page afterwards and observe "Server error" page

Expected Behavior

If specifying a device without interface is not allowed any request attempting to do this must be rejected.

It would be better though to allow to assign IP without specifying interface (for ephemeral interfaces or similar things) but probably this is a topic for another issue.

Observed Behavior

Attempt to open a device page which has IP assigned but without interface results in "Server error":

<class 'AttributeError'>

'ImageDraw' object has no attribute 'textsize'

Python version: 3.11.2
NetBox version: 3.5.7

Further, this "phantom" device assignment is invisible on IP page (no device shown) so it might be hard to detect where is the problem.

Originally created by @aldem on GitHub (Jul 30, 2023). ### NetBox version v3.5.7 ### Python version 3.11 ### Steps to Reproduce 1. Create any device (or choose existing one) for testing 2. Do a bulk IP import or use API to create an IP assigned to a device without specifying an interface, like this (bulk import): ```csv address,status,device 11.22.33.44/32,active,example.dev ``` 3. Try to open device page afterwards and observe "Server error" page ### Expected Behavior If specifying a device without interface is not allowed any request attempting to do this must be rejected. It would be better though to allow to assign IP without specifying interface (for ephemeral interfaces or similar things) but probably this is a topic for another issue. ### Observed Behavior Attempt to open a device page which has IP assigned but without interface results in "Server error": ``` <class 'AttributeError'> 'ImageDraw' object has no attribute 'textsize' Python version: 3.11.2 NetBox version: 3.5.7 ``` Further, this "phantom" device assignment is invisible on IP page (no device shown) so it might be hard to detect where is the problem.
adam added the type: bugstatus: duplicate labels 2025-12-29 20:36:04 +01:00
adam closed this issue 2025-12-29 20:36:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 30, 2023):

Duplicate of #13115. Please remember to search existing issues before submitting a new one.

@jeremystretch commented on GitHub (Jul 30, 2023): Duplicate of #13115. Please remember to search existing issues before submitting a new one.
Author
Owner

@aldem commented on GitHub (Jul 30, 2023):

Even worse... just noticed that all device pages produce "Server error" after this, and even deletion of IP address does not solve the issue.

@aldem commented on GitHub (Jul 30, 2023): Even worse... just noticed that *all* device pages produce "Server error" after this, and even deletion of IP address does not solve the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8384