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.

AttributeError: 'NoneType' object has no attribute 'mode'

See original GitHub issue

When running: python3 -m netbox_agent.cli --hostname_cmd “hostname -f” -c …/netbox_agent.yml -u --preserve-tags

i get 443 "GET /api/dcim/interfaces/?id=929&limit=0 HTTP/1.1" 200 52 Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/opt/netbox-agent/netbox_agent/cli.py", line 54, in <module> main() File "/opt/netbox-agent/netbox_agent/cli.py", line 50, in main return run(config) File "/opt/netbox-agent/netbox_agent/cli.py", line 43, in run server.netbox_create_or_update(config) File "/opt/netbox-agent/netbox_agent/virtualmachine.py", line 108, in netbox_create_or_update self.network.create_or_update_netbox_network_cards() File "/opt/netbox-agent/netbox_agent/network.py", line 443, in create_or_update_netbox_network_cards ret, interface = self.reset_vlan_on_interface(nic, interface) File "/opt/netbox-agent/netbox_agent/network.py", line 222, in reset_vlan_on_interface (interface.mode is not None or len(interface.tagged_vlans) > 0): AttributeError: 'NoneType' object has no attribute 'mode'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
KivraChristoffercommented, Jun 24, 2022

@devopstales network.py

215 # For strange reason, we need to get the object from scratch 216 # The object returned by pynetbox’s save isn’t always working (since pynetbox 6) 217 interface = nb.dcim.interfaces.get(id=interface.id) <---- interface = self.nb_net.interfaces.get(id=interface.id)

0reactions
KivraChristoffercommented, Jul 21, 2022

addressed in #232

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get AttributeError: 'NoneType' object has no attribute ...
It means the object you are trying to access None . None is a Null variable ...
Read more >
AttributeError: 'NoneType' object has no attribute ... - GitHub
i am running into the same issue "'NoneType' object has no attribute '_free_weak_ref'" while training yolov5 model on custom data. Any update on ......
Read more >
Why do I get AttributeError: 'NoneType' object has ... - Intellipaat
1 Answer ... You are getting AttributeError: 'NoneType' object has no attribute 'something' because NoneType means that instead of an instance of whatever...
Read more >
AttributeError: 'NoneType' object has no attribute 'head'
This error seems to indicate that when you're calling df.head() , the dataframe is actually empty – if you make sure that the...
Read more >
[FIXED] AttributeError: 'NoneType' object has no attribute ...
Hence, AttributeError: 'NoneType' object has no attribute 'something' error occurs when the type of object you are referencing is None.
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