netbox-proxbox: Error creating PVE node when there's existing Netbox device with the same name (duplicate)
I have set up the netbox-proxbox plugin following the setup guide in the README.MD
I also modified the models.py file to get it working with the newer netbox version
When I try to sync Proxmox to Netbox I get the following error:
<class 'AttributeError'>
'NoneType' object has no attribute 'name'
Python version: 3.10.6
NetBox version: 3.4.3
The stacktrace in the logs is as follows:
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: Internal Server Error: /plugins/proxbox/full_update/
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: Traceback (most recent call last):
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: response = get_response(request)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: response = wrapped_callback(request, *callback_args, **callback_kwargs)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in view
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: return self.dispatch(request, *args, **kwargs)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/venv/lib/python3.10/site-packages/django/contrib/auth/mixins.py", line 109, in dispatch
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: return super().dispatch(request, *args, **kwargs)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatch
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: return handler(request, *args, **kwargs)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/views.py", line 46, in get
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: update_all_result = proxbox_api.update.all(remove_unused = True)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/update.py", line 420, in all
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: node_updated = nodes(proxmox_json = px_node_each, proxmox_cluster = proxmox_cluster)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/update.py", line 378, in nodes
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: full_update = node_full_update(netbox_node, proxmox_json, proxmox_cluster)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/update.py", line 57, in node_full_update
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: cluster_updated = updates.node.cluster(netbox_node, proxmox_json, proxmox_cluster)
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: File "/opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/updates/node.py", line 52, in cluster
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: if netbox_node.cluster.name != proxmox_cluster['name']:
Jan 31 12:52:51 netbox-new-ubuntu gunicorn[7821]: AttributeError: 'NoneType' object has no attribute 'name'
I do see some stuff being created in netbox like the Cluster (with the correct name) and the cluster type and tag so it seems the connection between the plugin, Netbox and Proxmox works. What could be causing this issue?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (13 by maintainers)
Commits related to this issue
- Merge pull request #100 from netdevopsbr/cluster-nonetype Closes #27 and #75 - Create duplicate object with (2) appended if it already exist on Netbox. — committed to netdevopsbr/netbox-proxbox by emersonfelipesp a year ago
Could you please open other issue to report this interface related problem?
Thank you for providing useful information, I will let this Issue open while I work on the defintive solution.
Have you created another device with the same name as the PVE’s? Like
slc-app-02Thank you for testing, I will try to solve this and comeback to see if it works.