Wrong device Id on 2nd Termination for loop over Circuit #10779

Closed
opened 2025-12-29 21:35:51 +01:00 by adam · 2 comments
Owner

Originally created by @fggec on GitHub (Feb 19, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.1.11

Python Version

3.12

Steps to Reproduce

  1. Create Device with two interfaces
  2. Create Circuit
  3. connect each interface to one termination end
  4. trace the cable (i.e. http://127.0.0.1:8000/api/dcim/interfaces/1/trace/)

Expected Behavior

on each termination you should see the same device with the same id and same url to the device

Observed Behavior

on both ends different device (the device "ZZ-Generic_Whatever-02" is not existing) with different id and wrong url to the 2nd device.

It looks like netbox is generating another device thats not existing. It should use the same device twice.

HTTP 200 OK
Allow: GET, HEAD, OPTIONS, TRACE
Content-Type: application/json
Vary: Accept

[
    [
        [
            {
                "id": 1,
                "url": "https://[HereShouldBeMyIPv6]/api/dcim/interfaces/1/",
                "display": "Eth01",
                "device": {
                    "id": 1,
                    "url": "https://[HereShouldBeMyIPv6]/api/dcim/devices/1/",
                    "display": "ZZ-Generic_Whatever-01",
                    "name": "ZZ-Generic_Whatever-01",
                    "description": ""
                },
                "name": "Eth01",
                "description": "",
                "cable": {
                    "id": 1,
                    "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/1/",
                    "display": "#1",
                    "label": "",
                    "description": ""
                },
                "_occupied": true
            }
        ],
        {
            "id": 1,
            "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/1/",
            "display_url": "https://[HereShouldBeMyIPv6]/dcim/cables/1/",
            "type": "",
            "status": "connected",
            "label": "",
            "color": "",
            "length": null,
            "length_unit": "",
            "description": ""
        },
        [
            {
                "id": 1,
                "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuit-terminations/1/",
                "display": "111111: Termination A",
                "circuit": {
                    "id": 1,
                    "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuits/1/",
                    "display": "111111",
                    "cid": "111111",
                    "provider": {
                        "id": 1,
                        "url": "https://[HereShouldBeMyIPv6]/api/circuits/providers/1/",
                        "display": "ZZ-Provider-01",
                        "name": "ZZ-Provider-01",
                        "slug": "zz-provider-01",
                        "description": ""
                    },
                    "description": ""
                },
                "term_side": "A",
                "description": "",
                "cable": {
                    "id": 1,
                    "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/1/",
                    "display": "#1",
                    "label": "",
                    "description": ""
                },
                "_occupied": true
            }
        ]
    ],
    [
        [
            {
                "id": 2,
                "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuit-terminations/2/",
                "display": "111111: Termination Z",
                "circuit": {
                    "id": 1,
                    "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuits/1/",
                    "display": "111111",
                    "cid": "111111",
                    "provider": {
                        "id": 1,
                        "url": "https://[HereShouldBeMyIPv6]/api/circuits/providers/1/",
                        "display": "ZZ-Provider-01",
                        "name": "ZZ-Provider-01",
                        "slug": "zz-provider-01",
                        "description": ""
                    },
                    "description": ""
                },
                "term_side": "Z",
                "description": "",
                "cable": {
                    "id": 2,
                    "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/2/",
                    "display": "#2",
                    "label": "",
                    "description": ""
                },
                "_occupied": true
            }
        ],
        {
            "id": 2,
            "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/2/",
            "display_url": "https://[HereShouldBeMyIPv6]/dcim/cables/2/",
            "type": "",
            "status": "connected",
            "label": "",
            "color": "",
            "length": null,
            "length_unit": "",
            "description": ""
        },
        [
            {
                "id": 2,
                "url": "https://[HereShouldBeMyIPv6]/api/dcim/interfaces/2/",
                "display": "Eth01",
                "device": {
                    "id": 2,
                    "url": "https://[HereShouldBeMyIPv6]/api/dcim/devices/2/",
                    "display": "ZZ-Generic_Whatever-02",
                    "name": "ZZ-Generic_Whatever-02",
                    "description": ""
                },
                "name": "Eth01",
                "description": "",
                "cable": {
                    "id": 2,
                    "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/2/",
                    "display": "#2",
                    "label": "",
                    "description": ""
                },
                "_occupied": true
            }
        ]
    ]
]
Originally created by @fggec on GitHub (Feb 19, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.1.11 ### Python Version 3.12 ### Steps to Reproduce 1. Create Device with two interfaces 2. Create Circuit 3. connect each interface to one termination end 4. trace the cable (i.e. `http://127.0.0.1:8000/api/dcim/interfaces/1/trace/`) ### Expected Behavior on each termination you should see the same device with the same id and same url to the device ### Observed Behavior on both ends different device (the device "ZZ-Generic_Whatever-02" is not existing) with different id and wrong url to the 2nd device. It looks like netbox is generating another device thats not existing. It should use the same device twice. ```json HTTP 200 OK Allow: GET, HEAD, OPTIONS, TRACE Content-Type: application/json Vary: Accept [ [ [ { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/dcim/interfaces/1/", "display": "Eth01", "device": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/dcim/devices/1/", "display": "ZZ-Generic_Whatever-01", "name": "ZZ-Generic_Whatever-01", "description": "" }, "name": "Eth01", "description": "", "cable": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/1/", "display": "#1", "label": "", "description": "" }, "_occupied": true } ], { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/1/", "display_url": "https://[HereShouldBeMyIPv6]/dcim/cables/1/", "type": "", "status": "connected", "label": "", "color": "", "length": null, "length_unit": "", "description": "" }, [ { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuit-terminations/1/", "display": "111111: Termination A", "circuit": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuits/1/", "display": "111111", "cid": "111111", "provider": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/circuits/providers/1/", "display": "ZZ-Provider-01", "name": "ZZ-Provider-01", "slug": "zz-provider-01", "description": "" }, "description": "" }, "term_side": "A", "description": "", "cable": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/1/", "display": "#1", "label": "", "description": "" }, "_occupied": true } ] ], [ [ { "id": 2, "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuit-terminations/2/", "display": "111111: Termination Z", "circuit": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/circuits/circuits/1/", "display": "111111", "cid": "111111", "provider": { "id": 1, "url": "https://[HereShouldBeMyIPv6]/api/circuits/providers/1/", "display": "ZZ-Provider-01", "name": "ZZ-Provider-01", "slug": "zz-provider-01", "description": "" }, "description": "" }, "term_side": "Z", "description": "", "cable": { "id": 2, "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/2/", "display": "#2", "label": "", "description": "" }, "_occupied": true } ], { "id": 2, "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/2/", "display_url": "https://[HereShouldBeMyIPv6]/dcim/cables/2/", "type": "", "status": "connected", "label": "", "color": "", "length": null, "length_unit": "", "description": "" }, [ { "id": 2, "url": "https://[HereShouldBeMyIPv6]/api/dcim/interfaces/2/", "display": "Eth01", "device": { "id": 2, "url": "https://[HereShouldBeMyIPv6]/api/dcim/devices/2/", "display": "ZZ-Generic_Whatever-02", "name": "ZZ-Generic_Whatever-02", "description": "" }, "name": "Eth01", "description": "", "cable": { "id": 2, "url": "https://[HereShouldBeMyIPv6]/api/dcim/cables/2/", "display": "#2", "label": "", "description": "" }, "_occupied": true } ] ] ] ```
adam closed this issue 2025-12-29 21:35:51 +01:00
Author
Owner

@bctiemann commented on GitHub (Feb 24, 2025):

@fggec Could you please provide more details on the repro steps, particularly the "Create Circuit" step? How should the circuit be created? What terminations are specified? How are the cables connected?

@bctiemann commented on GitHub (Feb 24, 2025): @fggec Could you please provide more details on the repro steps, particularly the "Create Circuit" step? How should the circuit be created? What terminations are specified? How are the cables connected?
Author
Owner

@fggec commented on GitHub (Feb 25, 2025):

@bctiemann nvm. I don't now why but today it is working and shows the correct path.

@fggec commented on GitHub (Feb 25, 2025): @bctiemann nvm. I don't now why but today it is working and shows the correct path.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10779