You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expectation is the ability to use the SSoT ACI app to sync with multiple ACI fabrics.
{ "exc_message": [ "Cannot delete some instances of model 'DeviceType' because they are referenced through protected foreign keys: 'Device.device_type'.", [ { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "A", "id": "d9acf8d9-6b21-419d-b1c9-3d1c4f3071f0" }, { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "B", "id": "cc1bc0e7-e688-4051-b07b-a671c4286540" }, { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "C", "id": "ee33d4ac-8bcb-4e80-80d0-827bcff1a42b" }, { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "D", "id": "d3558227-4054-4c2c-af85-6904f1e5ce91" } ] ], "exc_module": "django.db.models.deletion", "exc_type": "ProtectedError" }
Traceback (most recent call last): File "/opt/nautobot/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task R = retval = fun(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/celery/app/trace.py", line 760, in __protected_call__ return self.run(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 1234, in run_job result = job(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 160, in __call__ return self.run(*args, **deserialized_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/integrations/aci/jobs.py", line 105, in run super().run(dryrun=self.dryrun, memory_profiling=self.memory_profiling, *args, **kwargs) File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 354, in run self.sync_data(memory_profiling) File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 196, in sync_data self.execute_sync() File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 98, in execute_sync self.source_adapter.sync_to(self.target_adapter, flags=self.diffsync_flags) File "/opt/nautobot/lib/python3.11/site-packages/diffsync/__init__.py", line 626, in sync_to return target.sync_from(self, diff_class=diff_class, flags=flags, callback=callback, diff=diff) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/__init__.py", line 598, in sync_from result = syncer.perform_sync() ^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/helpers.py", line 329, in perform_sync changed |= self.sync_diff_element(element) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/helpers.py", line 379, in sync_diff_element changed, modified_model = self.sync_model(src_model=src_model, dst_model=dst_model, ids=ids, attrs=attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/helpers.py", line 436, in sync_model dst_model = dst_model.delete() ^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/integrations/aci/diffsync/models/nautobot.py", line 139, in delete _devicetype.delete() File "/opt/nautobot/lib/python3.11/site-packages/nautobot/dcim/models/devices.py", line 375, in delete super().delete(*args, **kwargs) File "/opt/nautobot/lib/python3.11/site-packages/django/db/models/base.py", line 1131, in delete collector.collect([self], keep_parents=keep_parents) File "/opt/nautobot/lib/python3.11/site-packages/django/db/models/deletion.py", line 355, in collect raise ProtectedError( django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'DeviceType' because they are referenced through protected foreign keys: 'Device.device_type'.", {<Device: A>, <Device: B>, <Device: C>, <Device: D>})
Observed Behavior
When more than 1 fabric are synced using the app, and one fabric does not contain the same device types that the other fabric(s) do, the plugin attempts to remove the device type definitions because they are not present in syncing fabric. This causes an error because the device type definitons are tied to devices created from the other fabric sync jobs.
Steps to Reproduce
Configure SSoT to talk to 2 unique fabrics
Ensure each external integration uses a unique "tenant_prefix" extra config setting so the fabric tenant names do not collide.
Have a mismatch between the 2 fabrics with the device models deployed
Run a sync job against the fabric that has a device model that is not included in the secondary fabric
Run a sync job against the secondary fabric.
Observe the error of the job trying to remove a devicetype that was populated from the other fabric's sync job.
The text was updated successfully, but these errors were encountered:
Environment
Expected Behavior
The expectation is the ability to use the SSoT ACI app to sync with multiple ACI fabrics.
{ "exc_message": [ "Cannot delete some instances of model 'DeviceType' because they are referenced through protected foreign keys: 'Device.device_type'.", [ { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "A", "id": "d9acf8d9-6b21-419d-b1c9-3d1c4f3071f0" }, { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "B", "id": "cc1bc0e7-e688-4051-b07b-a671c4286540" }, { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "C", "id": "ee33d4ac-8bcb-4e80-80d0-827bcff1a42b" }, { "__nautobot_type__": "nautobot.dcim.models.devices.Device", "display": "D", "id": "d3558227-4054-4c2c-af85-6904f1e5ce91" } ] ], "exc_module": "django.db.models.deletion", "exc_type": "ProtectedError" }
Traceback (most recent call last): File "/opt/nautobot/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task R = retval = fun(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/celery/app/trace.py", line 760, in __protected_call__ return self.run(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 1234, in run_job result = job(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 160, in __call__ return self.run(*args, **deserialized_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/integrations/aci/jobs.py", line 105, in run super().run(dryrun=self.dryrun, memory_profiling=self.memory_profiling, *args, **kwargs) File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 354, in run self.sync_data(memory_profiling) File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 196, in sync_data self.execute_sync() File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 98, in execute_sync self.source_adapter.sync_to(self.target_adapter, flags=self.diffsync_flags) File "/opt/nautobot/lib/python3.11/site-packages/diffsync/__init__.py", line 626, in sync_to return target.sync_from(self, diff_class=diff_class, flags=flags, callback=callback, diff=diff) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/__init__.py", line 598, in sync_from result = syncer.perform_sync() ^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/helpers.py", line 329, in perform_sync changed |= self.sync_diff_element(element) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/helpers.py", line 379, in sync_diff_element changed, modified_model = self.sync_model(src_model=src_model, dst_model=dst_model, ids=ids, attrs=attrs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/diffsync/helpers.py", line 436, in sync_model dst_model = dst_model.delete() ^^^^^^^^^^^^^^^^^^ File "/opt/nautobot/lib/python3.11/site-packages/nautobot_ssot/integrations/aci/diffsync/models/nautobot.py", line 139, in delete _devicetype.delete() File "/opt/nautobot/lib/python3.11/site-packages/nautobot/dcim/models/devices.py", line 375, in delete super().delete(*args, **kwargs) File "/opt/nautobot/lib/python3.11/site-packages/django/db/models/base.py", line 1131, in delete collector.collect([self], keep_parents=keep_parents) File "/opt/nautobot/lib/python3.11/site-packages/django/db/models/deletion.py", line 355, in collect raise ProtectedError( django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'DeviceType' because they are referenced through protected foreign keys: 'Device.device_type'.", {<Device: A>, <Device: B>, <Device: C>, <Device: D>})
Observed Behavior
When more than 1 fabric are synced using the app, and one fabric does not contain the same device types that the other fabric(s) do, the plugin attempts to remove the device type definitions because they are not present in syncing fabric. This causes an error because the device type definitons are tied to devices created from the other fabric sync jobs.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: