nautobot-app-ssot
nautobot-app-ssot copied to clipboard
ACI Sync Job fails with TypeError: 'str' object is not callable
Environment
- Python version: 3.10.12
- Nautobot version: 2.2.7
- nautobot-ssot version: 2.6.1
Expected Behavior
Expected to synchronize data from ACI fabric to NB instance
Observed Behavior
Running the job connects to the ACI APIC and starts to pull data, upon reaching the load_devices code errors with the below stack trace:
`Traceback (most recent call last): File "/opt/nautobot/lib/python3.10/site-packages/diffsync/store/init.py", line 155, in get_or_instantiate obj = self.get(model=model, identifier=ids) File "/opt/nautobot/lib/python3.10/site-packages/diffsync/store/local.py", line 49, in get raise ObjectNotFound(f"{modelname} {uid} not present in {str(self)}") diffsync.exceptions.ObjectNotFound: device_type N9K-C93180YC-FX3__ not present in LocalStore
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/nautobot/lib/python3.10/site-packages/celery/app/trace.py", line 477, in trace_task R = retval = fun(*args, **kwargs) File "/opt/nautobot/lib/python3.10/site-packages/celery/app/trace.py", line 760, in protected_call return self.run(*args, **kwargs) File "/opt/nautobot/lib/python3.10/site-packages/nautobot/extras/jobs.py", line 1136, in run_job result = job(*args, **kwargs) File "/opt/nautobot/lib/python3.10/site-packages/nautobot/extras/jobs.py", line 149, in call return self.run(*args, **deserialized_kwargs) File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/integrations/aci/jobs.py", line 90, in run super().run(dryrun=self.dryrun, memory_profiling=self.memory_profiling, *args, **kwargs) File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/jobs/base.py", line 317, in run self.sync_data(memory_profiling) File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/jobs/base.py", line 136, in sync_data self.load_source_adapter() File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/integrations/aci/jobs.py", line 75, in load_source_adapter self.source_adapter.load() File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/integrations/aci/diffsync/adapters/aci.py", line 438, in load self.load_devices() File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/integrations/aci/diffsync/adapters/aci.py", line 412, in load_devices self.get_or_instantiate( File "/opt/nautobot/lib/python3.10/site-packages/diffsync/init.py", line 813, in get_or_instantiate return self.store.get_or_instantiate(model=model, ids=ids, attrs=attrs) File "/opt/nautobot/lib/python3.10/site-packages/diffsync/store/init.py", line 159, in get_or_instantiate obj = model(**ids, **attrs) TypeError: 'str' object is not callable`
Steps to Reproduce
Create nautobot install Ensure SSOT[ACI] is installed and properly loaded with correct environmental variables Enable sync job Execute sync job against controller.
Suspected Cause
Within the plugin code for the ACI adapter load_devices() is calling self.get_or_instantiate() passing a string in of "device_type" for the model argument. Further in the code, diffsync is attempting to execute whatever this argument is as a method. Given that string types are not callable it throws the error. I suspect that get_or_instantiate is being called with incorrect argument as the "model" argument.