robertcsapo / ciscodnacnetbox

Cisco DNA Center Integration with NetBox
Other
34 stars 14 forks source link

Unable to sync #9

Open Wh8staffs opened 1 year ago

Wh8staffs commented 1 year ago

This plugin has been installed but i'm unable to get any details to sync between the two enviroments. I could be missing something simple but I'm struggling to find any clear output on what is broken here.
I get this error:

![image](https://user-images.githubusercontent.com/114669715/193037522-dffe900c-f519-4aa9-b51f-cf2387af164e.png) The same shows if I hover over both the site and device sync buttons.

Python version: 3.8.12
NetBox version: 3.2.6
DNA Center version: 2.2.3.5

Wh8staffs commented 1 year ago

To add to this i have done some more testing and i can successfully sync with the sandbox dna center. but looking that seems to be running on an older version of DNA.

image

robertcsapo commented 1 year ago

Could you share the console logs from NetBox as you go to the Status page?

What version of this plugin are you running?

Wh8staffs commented 1 year ago

Hi Rob, Apologies for the delay I have been OOO.

I am using version 3.2.3: [root@vmt3unetbox1 bin]# ./pip3 list | grep cisco ciscodnacnetbox 3.2.3

Here are the console logs:

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/netbox-3.2.6/venv/lib64/python3.8/site-packages/django/template/base.py", line 898, in _resolve_lookup raise VariableDoesNotExist( django.template.base.VariableDoesNotExist: Failed lookup for key [form] in [{'True': True, 'False': False, 'None': None}, {'csrf_token': <SimpleLazyObject: <function csrf.._get_val at 0x7f776594b430>>, 're: request=<WSGIRequest: GET '/plugins/ciscodnacnetbox/status/'>>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40}, 'settings': <LazySettings "netbox.settings">, 'coule', 'devicebay', 'consoleserverport', 'region', 'poweroutlet', 'modulebay', 'devicetype', 'powerfeed', 'powerpanel', 'site', 'powerport', 'location', 'interface', 'consoleport', 'manufacturer', 'virtualchassis'{'vlan', 'service', 'vlangroup', 'rir', 'aggregate', 'iprange', 'vrf', 'servicetemplate', 'prefix', 'asn', 'role', 'routetarget', 'fhrpgroup', 'ipaddress'}, 'virtualization': {'clustergroup', 'clustertype', 'vmin<class 'set'>, {'extras': {'journalentry'}, 'dcim': {'rack', 'rackreservation', 'moduletype', 'module', 'devicebay', 'consoleserverport', 'region', 'poweroutlet', 'modulebay', 'devicetype', 'powerfeed', 'powerpanort', 'platform'}, 'circuits': {'circuittype', 'circuit', 'provider', 'providernetwork'}, 'ipam': {'vlan', 'service', 'vlangroup', 'rir', 'aggregate', 'iprange', 'vrf', 'servicetemplate', 'prefix', 'asn', 'role',}, 'wireless': {'wirelesslan', 'wirelesslangroup', 'wirelesslink'}}), 'export_templates': defaultdict(<class 'set'>, {'extras': {'customfield', 'customlink', 'webhook', 'exporttemplate', 'tag'}, 'dcim': {'rack', , 'manufacturer', 'virtualchassis', 'sitegroup', 'rackrole', 'cable', 'devicerole', 'inventoryitemrole', 'inventoryitem', 'frontport', 'device', 'rearport', 'platform'}, 'circuits': {'circuittype', 'circuit', 'prlustergroup', 'clustertype', 'vminterface', 'cluster', 'virtualmachine'}, 'tenancy': {'tenantgroup', 'contactrole', 'tenant', 'contact', 'contactgroup'}, 'wireless': {'wirelesslan', 'wirelesslangroup', 'wirelesslport', 'region', 'poweroutlet', 'modulebay', 'devicetype', 'powerfeed', 'powerpanel', 'site', 'powerport', 'location', 'interface', 'consoleport', 'manufacturer', 'virtualchassis', 'sitegroup', 'rackrole', 'cable'rir', 'aggregate', 'iprange', 'vrf', 'servicetemplate', 'prefix', 'asn', 'role', 'routetarget', 'fhrpgroup', 'ipaddress'}, 'virtualization': {'clustergroup', 'clustertype', 'vminterface', 'cluster', 'virtualmach}, 'dcim': {'rack', 'rackreservation', 'moduletype', 'module', 'devicebay', 'consoleserverport', 'region', 'poweroutlet', 'modulebay', 'devicetype', 'powerfeed', 'powerpanel', 'site', 'powerport', 'location', 'inype', 'circuit', 'provider', 'providernetwork'}, 'ipam': {'vlan', 'service', 'vlangroup', 'rir', 'aggregate', 'iprange', 'vrf', 'servicetemplate', 'prefix', 'asn', 'role', 'routetarget', 'fhrpgroup', 'ipaddress'}angroup', 'wirelesslink'}}), 'webhooks': defaultdict(<class 'set'>, {'extras': {'customfield', 'customlink', 'configcontext', 'webhook', 'exporttemplate', 'tag', 'journalentry', 'imageattachment'}, 'dcim': {'racknel', 'site', 'powerport', 'location', 'consoleserverporttemplate', 'interface', 'consoleport', 'manufacturer', 'virtualchassis', 'consoleporttemplate', 'sitegroup', 'rackrole', 'cable', 'devicebaytemplate', 'devidernetwork', 'circuittermination', 'provider', 'circuittype'}, 'ipam': {'vlan', 'service', 'vlangroup', 'fhrpgroupassignment', 'rir', 'aggregate', 'iprange', 'vrf', 'servicetemplate', 'prefix', 'asn', 'role', 'rt', 'contactgroup'}, 'wireless': {'wirelesslan', 'wirelesslangroup', 'wirelesslink'}})}, 'plugins': {'graphql_schemas': [], 'menu_items': {'Cisco DNA Center Sync Plugin': (<extras.plugins.PluginMenuItem object atces': None, 'api': JSONDecodeError('Expecting value: line 3 column 1 (char 4)')}, 'sandboxdnac.cisco.com': {'id': 3, 'sites': 3, 'devices': 4, 'api': 'success'}}, 'netbox': 'https://10.206.12.5/', 'netbox_sites':e.utc), 'managed': True}}}, {}] 2022-10-10 10:53:18,400 django.template DEBUG: Exception while resolving variable 'form' in template 'ciscodnacnetbox/status.html'. Traceback (most recent call last): File "/opt/netbox-3.2.6/venv/lib64/python3.8/site-packages/django/template/base.py", line 875, in _resolve_lookup current = current[bit] File "/opt/netbox-3.2.6/venv/lib64/python3.8/site-packages/django/template/context.py", line 83, in getitem raise KeyError(key) KeyError: 'form'

robertcsapo commented 1 year ago

thanks, i'll try to reproduce this.

robertcsapo commented 1 year ago

I haven't been able to reproduce this problem. The plugin was also tested with Cisco DNA Center version 2.3.4.0

Wh8staffs commented 1 year ago

Hi rob, No problem I have done some more digging just and have narrowed the issue down to the domain leading to the proxy rather than the DNA server (a fact I wasn't aware of until just) I can now get them to sync.

However, the sync is missing in about 50% of the devices. We have nearly 1000 devices including access points. But of that net box only syncs 487. I'm still trying to work out if there are any connections between the missing devices but there are no logs to indicate anything crashed/failed.

robertcsapo commented 1 year ago

I'll try to look if there's any pagination needed for 1000 devices

Wh8staffs commented 1 year ago

Thanks for that! There doesn't look to be any specific link between the missing devices, i.e. no specific model or location. Just seems to get so far and then stop.