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
{{ message }}
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
Getting an error after upgrading to latest and running nautobot-server post_upgrade
Traceback (most recent call last):
File "/opt/nautobot/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "extras_customfield_name_key"
DETAIL: Key (name)=(arista_eostrain) already exists.
Steps to Reproduce
pip install nautobot-ssot-aristacv --upgrade
nautobot-server post_upgrade
More details
I was able to workaround the error by deleting all CustomFields from the Nautobot instance and try again. After that the error is gone and the upgrades succeeds.
Another issue that came with the upgrade to 1.5.0 is that enabling the create controller feature causes some error on the imported CloudVision device. After the initial sync, the CloudVision controller is created with empty CustomFields values. After trying subsequent syncs, there is an error:
Traceback (most recent call last):
File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/jobs/base.py", line 332, in run
self.sync_data()
File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot/jobs/base.py", line 146, in sync_data
self.load_target_adapter()
File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot_aristacv/jobs.py", line 115, in load_target_adapter
self.target_adapter.load()
File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot_aristacv/diffsync/adapters/nautobot.py", line 140, in load
self.load_devices()
File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot_aristacv/diffsync/adapters/nautobot.py", line 45, in load_devices
version=nautobot.get_device_version(dev),
File "/opt/nautobot/lib/python3.10/site-packages/nautobot_ssot_aristacv/utils/nautobot.py", line 94, in get_device_version
version = device.custom_field_data["arista_eos"]
KeyError: 'arista_eos'
After checking further, there is no arista_eos value for the CloudVision device:
>>> for dev in Device.objects.all():
... print(f"Arista EOS CF for {dev.name} is {dev.custom_field_data['arista_eos'] if dev.custom_field_data.get('arista_eos') else 'MISSING' }")
...
Arista EOS CF for CloudVision is MISSING
Arista EOS CF for nsx01-borderleaf-01 is 4.28.3M
Arista EOS CF for nsx01-leaf-01 is 4.28.5M
Arista EOS CF for nsx01-leaf-02 is 4.28.5M
After manually adding a value to the CloudVision arista_eos field, the problem is solved and subsequent syncs succeeds.
Reference Slack conversation (troubleshoot and debug)
* fix: 🐛 Use update_or_create instead of get_or_create. Fixes#143 and #133
* fix: 🐛 Add handling in case arista_eos field is None
In case the version isn't set this should return empty string
* fix: 🐛 Ensure that EOS Version CF is created for CloudVision
* style: 🚨 Fix linter warnings
---------
Co-authored-by: Justin Drew <jdrew82@users.noreply.github.com>
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Environment
Expected Behavior
Upgrade from 1.4.0 to 1.5.0 without issues.
Observed Behavior
Getting an error after upgrading to latest and running
nautobot-server post_upgrade
Steps to Reproduce
More details
I was able to workaround the error by deleting all CustomFields from the Nautobot instance and try again. After that the error is gone and the upgrades succeeds.
Another issue that came with the upgrade to 1.5.0 is that enabling the
create controller
feature causes some error on the imported CloudVision device. After the initial sync, the CloudVision controller is created with empty CustomFields values. After trying subsequent syncs, there is an error:After checking further, there is no
arista_eos
value for the CloudVision device:After manually adding a value to the CloudVision
arista_eos
field, the problem is solved and subsequent syncs succeeds.Reference Slack conversation (troubleshoot and debug)
https://networktocode.slack.com/archives/C01NWPK6WHL/p1676042235148109
The text was updated successfully, but these errors were encountered: