Unassigned IP address migration issue #6421

Closed
opened 2025-12-29 19:40:32 +01:00 by adam · 0 comments
Owner

Originally created by @irozkov on GitHub (Apr 29, 2022).

NetBox version

v3.2.2

Python version

3.8

Steps to Reproduce

Clean install NetBox 3.2.1 or NetBox 3.2.2
Dump NetBox 3.1.1 database
Run upgrade.sh to migrate from NetBox 3.1.11

Expected Behavior

For IPs not assigned to the object API to return / keep "assigned_object_type" null value

Example (before migration / NetBox 3.1.11):

{
"id": 5631,
"url": "http://localhost:8002/api/ipam/ip-addresses/5631/",
"display": "10.200.0.5/32",
"family": {
"value": 4,
"label": "IPv4"
},
"address": "10.200.0.5/32",
"vrf": {
"id": 28,
"url": "http://localhost:8002/api/ipam/vrfs/28/",
"display": "TNX",
"name": "TNX",
"rd": null
},
"tenant": {
"id": 20,
"url": "http://localhost:8002/api/tenancy/tenants/20/",
"display": "TNX",
"name": "TNX",
"slug": "tnx"
},
"status": {
"value": "active",
"label": "Active"
},
"role": null,
"assigned_object_type": null,
"assigned_object_id": null,
"assigned_object": null,
"nat_inside": null,
"nat_outside": null,
"dns_name": "aws-dc1",
"description": "",
"tags": [
{
"id": 5,
"url": "http://localhost:8002/api/extras/tags/5/",
"display": "MSR-AVL-INT",
"name": "MSR-AVL-INT",
"slug": "msr-avl-int",
"color": "ffeb3b"
}
],
"custom_fields": {},
"created": "2020-09-06",
"last_updated": "2020-09-06T18:04:42.114987Z"
}

Observed Behavior

For IPs not assigned to the object receive API response with "assigned_object_type" set to "dcim.interface"

Example (after migration / NetBox 3.2.2):

{
"id": 5631,
"url": "http://localhost:8003/api/ipam/ip-addresses/5631/",
"display": "10.200.0.5/32",
"family": {
"value": 4,
"label": "IPv4"
},
"address": "10.200.0.5/32",
"vrf": {
"id": 28,
"url": "http://localhost:8003/api/ipam/vrfs/28/",
"display": "TNX",
"name": "TNX",
"rd": null
},
"tenant": {
"id": 20,
"url": "http://localhost:8003/api/tenancy/tenants/20/",
"display": "TNX",
"name": "TNX",
"slug": "tnx"
},
"status": {
"value": "active",
"label": "Active"
},
"role": null,
"assigned_object_type": "dcim.interface",
"assigned_object_id": null,
"assigned_object": null,
"nat_inside": null,
"nat_outside": null,
"dns_name": "aws-dc1",
"description": "",
"tags": [
{
"id": 5,
"url": "http://localhost:8003/api/extras/tags/5/",
"display": "MSR-AVL-INT",
"name": "MSR-AVL-INT",
"slug": "msr-avl-int",
"color": "ffeb3b"
}
],
"custom_fields": {},
"created": "2020-09-06T00:00:00Z",
"last_updated": "2020-09-06T18:04:42.114987Z"
}

Originally created by @irozkov on GitHub (Apr 29, 2022). ### NetBox version v3.2.2 ### Python version 3.8 ### Steps to Reproduce Clean install NetBox 3.2.1 or NetBox 3.2.2 Dump NetBox 3.1.1 database Run upgrade.sh to migrate from NetBox 3.1.11 ### Expected Behavior For IPs not assigned to the object API to return / keep "assigned_object_type" null value Example (before migration / NetBox 3.1.11): { "id": 5631, "url": "http://localhost:8002/api/ipam/ip-addresses/5631/", "display": "10.200.0.5/32", "family": { "value": 4, "label": "IPv4" }, "address": "10.200.0.5/32", "vrf": { "id": 28, "url": "http://localhost:8002/api/ipam/vrfs/28/", "display": "TNX", "name": "TNX", "rd": null }, "tenant": { "id": 20, "url": "http://localhost:8002/api/tenancy/tenants/20/", "display": "TNX", "name": "TNX", "slug": "tnx" }, "status": { "value": "active", "label": "Active" }, "role": null, "assigned_object_type": null, "assigned_object_id": null, "assigned_object": null, "nat_inside": null, "nat_outside": null, "dns_name": "aws-dc1", "description": "", "tags": [ { "id": 5, "url": "http://localhost:8002/api/extras/tags/5/", "display": "MSR-AVL-INT", "name": "MSR-AVL-INT", "slug": "msr-avl-int", "color": "ffeb3b" } ], "custom_fields": {}, "created": "2020-09-06", "last_updated": "2020-09-06T18:04:42.114987Z" } ### Observed Behavior For IPs not assigned to the object receive API response with "assigned_object_type" set to "dcim.interface" Example (after migration / NetBox 3.2.2): { "id": 5631, "url": "http://localhost:8003/api/ipam/ip-addresses/5631/", "display": "10.200.0.5/32", "family": { "value": 4, "label": "IPv4" }, "address": "10.200.0.5/32", "vrf": { "id": 28, "url": "http://localhost:8003/api/ipam/vrfs/28/", "display": "TNX", "name": "TNX", "rd": null }, "tenant": { "id": 20, "url": "http://localhost:8003/api/tenancy/tenants/20/", "display": "TNX", "name": "TNX", "slug": "tnx" }, "status": { "value": "active", "label": "Active" }, "role": null, "assigned_object_type": "dcim.interface", "assigned_object_id": null, "assigned_object": null, "nat_inside": null, "nat_outside": null, "dns_name": "aws-dc1", "description": "", "tags": [ { "id": 5, "url": "http://localhost:8003/api/extras/tags/5/", "display": "MSR-AVL-INT", "name": "MSR-AVL-INT", "slug": "msr-avl-int", "color": "ffeb3b" } ], "custom_fields": {}, "created": "2020-09-06T00:00:00Z", "last_updated": "2020-09-06T18:04:42.114987Z" }
adam added the type: bug label 2025-12-29 19:40:32 +01:00
adam closed this issue 2025-12-29 19:40:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6421