question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'CircuitTermination' object has no attribute 'name'

See original GitHub issue

Environment

  • Python version: “3.7.3”
  • NetBox version: “2.10.3”

Steps to Reproduce

On the API, in the page 3 i have this error 500:

"Got AttributeError when attempting to get a value for field `name` on serializer `NestedInterfaceSerializer`.\nThe serializer field might be named incorrectly and not match any attribute or key on the `CircuitTermination` instance.\nOriginal exception text was: 'CircuitTermination' object has no attribute 'name'."

URL called is : https://netbox/api/circuits/circuits/?cf_technology=VDSL&offset=100&type=s-internet-over-best-effort-line

I have 167 circuits that match my search. Only part 100 - 150 does not work.

This URL works :

URL called is : https://netbox/api/circuits/circuits/?cf_technology=VDSL&type=s-internet-over-best-effort-line URL called is : https://netbox/api/circuits/circuits/?cf_technology=VDSL&offset=50&type=s-internet-over-best-effort-line URL called is : https://netbox/api/circuits/circuits/?cf_technology=VDSL&offset=150&type=s-internet-over-best-effort-line

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremystretchcommented, Feb 8, 2021

Thank you @Hedius for taking the time to provide a detailed reproduction script per the issue template. Using the information you provided, I was able to replicate the reported bug, and can now work on fixing it.

1reaction
Hediuscommented, Jan 26, 2021

Environment

  • Python version: “3.9.1” (also happens on 3.7)
  • NetBox version: “2.10.3”

Hello. Clean/Empty installation. Maybe less steps are needed, but our setup for this issue looks exactly like this.

Steps to Reproduce

  1. Create Provider1

  2. Create Provider2

  3. Create Tenant1

  4. Create Tenant2

  5. Create Site1

  6. Create Device Role: Cable Management

  7. Create Manufacturer1

  8. Create Device Type: housing-panel – Manufacturer1 – Height 1U

  9. Create Device Tray1 – Role: Cable Management – Device Type: housing-panel – Site: Site1 – Tenant: Tenant1

  10. Add a rear port: Rear Port 1 – Type: LC/APC

  11. Add a front port: Front Port 1 – Type: LC/APC – Assign the rear port

  12. Create a Circuit Type: CircuitType1

  13. Add Circuit1 – Provider: Provider1 – Type: CircuitType1 – Tenant: Tenant1

  14. Add Circuit2 – Provider: Provider2 – Type: CircuitType1 – Tenant: Tenant2

  15. Add a Z side to Circuit1 – Site: Site1 – 100Gbps up/down

  16. Add a Z side to Circuit2 – Site: Site1 – 100Gbps up/down

  17. Cable the Z side of Circuit1 to the device tray1 (Front Port 1)

  18. Cable the Z side of Circuit2 to the device tray1 (Rear Port 1)

The setup should look like this: 581a1e4c-3b14-43d3-92ad-574fd5cb2956

Expected Behavior

The following queries should not fail: /api/circuits/circuits/2/ /api/circuits/circuits/1/ /api/circuits/circuits/

Observed Behavior

After doing this, opening both circuits via the API will fail: {"error": "Got AttributeError when attempting to get a value for field `name` on serializer `NestedInterfaceSerializer`.\nThe serializer field might be named incorrectly and not match any attribute or key on the `CircuitTermination` instance.\nOriginal exception text was: 'CircuitTermination' object has no attribute 'name'.", "exception": "AttributeError", "netbox_version": "2.10.3", "python_version": "3.9.1"}

Queries that will fail: /api/circuits/circuits/2/ /api/circuits/circuits/1/ /api/circuits/circuits/

Conclusion

The problem is caused by the cables (maybe). Removing a cable will fix the problem for the now unplugged circuit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with export templates after upgrade to 2.11
Interface object' has no attribute 'cable_peer'. It seems I can't access data outside of the interface scope any longer.
Read more >
AttributeError: 'Anonymousidentity' object has no attribute 'name'
I'm using Flask to build a website. But when I open 127.0.0.1:5000, it returns AttributeError: 'Anonymousidentity' object has no attribute 'name ...
Read more >
nautobot-circuit-maintenance - PyPI
The plugin is compatible with Nautobot 1.0.0b4 and higher ... "labels_attached") with the label name and the attributes within the Circuit object.
Read more >
Posts by Year - NetBox.dev
The first beta release for NetBox v3.4 has just been released! ... object names; #9775 - Fix exception when viewing a report with...
Read more >
CHANGELOG.md - netbox - GitLab
API Support for Specifying Related Objects by Attributes(#3077) ... raised when creating/viewing a circuit with a non-connected termination ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found