-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hello,
After few days trying to have the plugin working, I finally was able to get it almost working. I see the Sites and Devices are discovered, however when i want to sync, the Sites and only 2 devices sync out of 170 and i get this error:
=================================================================
ciscodnacnetbox.ciscodnac.data.full_sync
Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/options.py", line 681, in get_field return self.fields_map[field_name] KeyError: 'device_role' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/ciscodnacnetbox/ciscodnac/netbox.py", line 281, in device Device.objects.filter( File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/query.py", line 1188, in update query.add_update_values(kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/sql/subqueries.py", line 88, in add_update_values field = self.get_meta().get_field(name) File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/options.py", line 683, in get_field raise FieldDoesNotExist( django.core.exceptions.FieldDoesNotExist: Device has no field named 'device_role' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/options.py", line 681, in get_field return self.fields_map[field_name] KeyError: 'device_role' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/rq/worker.py", line 1428, in perform_job rv = job.perform() File "/opt/netbox/venv/lib/python3.10/site-packages/rq/job.py", line 1278, in perform self._result = self._execute() File "/opt/netbox/venv/lib/python3.10/site-packages/rq/job.py", line 1315, in _execute result = self.func(*self.args, **self.kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/ciscodnacnetbox/ciscodnac/data.py", line 23, in full_sync devices = Data.sync_devices(**kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/ciscodnacnetbox/ciscodnac/data.py", line 335, in sync_devices sync_status = Netbox.Sync.device(tenant=tenant, device=device) File "/opt/netbox/venv/lib/python3.10/site-packages/ciscodnacnetbox/ciscodnac/netbox.py", line 297, in device Device.objects.filter( File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/query.py", line 1188, in update query.add_update_values(kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/sql/subqueries.py", line 88, in add_update_values field = self.get_meta().get_field(name) File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/models/options.py", line 683, in get_field raise FieldDoesNotExist( django.core.exceptions.FieldDoesNotExist: Device has no field named 'device_role'
Can't figure out what's the problem with device role, when discover devices, they all have a role, and Netbox creates new according to the ones from DNA based only the two devices netbox was able to add.
Since I had issues making the module working in the beginning, I spun a new VM and installed netbox 3.5.4 and there everything syncs.
the plugin version I believe is the latest:
pip list | grep ciscodnac
ciscodnacnetbox 3.5.0
However in the browser when I get the error, it shows me and older version.
+++++++++++++++++++++++++++++=
<class 'django.core.exceptions.FieldDoesNotExist'>
Device has no field named 'device_role'
Python version: 3.10.12
NetBox version: 3.7.1
Plugins:
ciscodnacnetbox: 3.2.1
netbox_qrcode: 0.0.11
netbox_topology_views: 3.9.0
+++++++++++++++++++++++++++++=
Any help is much appreciated.