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
In ssot.contrib, when creating/updating an object with data that fails the various validation constraints, the message "Validated save failed for Django object. Parameters: {.......}" is logged.
It would be more helpful to also log the contents of the django ValidationError that is raised, to give a hint of what went wrong.
Example:
log Validated save failed for Django object: Interface with this Device and Name already exists. Parameters: {'name': 'port-channel12', 'device__name': 'xyz', 'description': 'something', 'enabled': True, 'type': 'other', 'mode': 'tagged', 'status__name': 'Active', 'lag__name': None, 'lag__device__name': None, 'untagged_vlan__vid': 33, 'untagged_vlan__name': 'foobar-dhcp', 'tagged_vlans': [{'vid': 33, 'name': 'foobar-dhcp'}, {'vid': 99, 'name': 'foobar-baz'}], 'trunk_groups': [], 'mgmt_only': False, 'vrf__name': None, 'vrf__namespace__name': None}
instead of Validated save failed for Django object. Parameters: {'name': 'port-channel12', 'device__name': 'xyz', 'description': 'something', 'enabled': True, 'type': 'other', 'mode': 'tagged', 'status__name': 'Active', 'lag__name': None, 'lag__device__name': None, 'untagged_vlan__vid': 33, 'untagged_vlan__name': 'foobar-dhcp', 'tagged_vlans': [{'vid': 33, 'name': 'foobar-dhcp'}, {'vid': 99, 'name': 'foobar-baz'}], 'trunk_groups': [], 'mgmt_only': False, 'vrf__name': None, 'vrf__namespace__name': None}
(this one left me puzzled for a while since there were 14 parameters to check. It turned out I already had "Port-Channel12" and was trying to create "port-channel12")
Use Case
Easier troubleshooting of error messages
The text was updated successfully, but these errors were encountered:
So this particular error is actually coming from Django itself. With that in mind, there's nothing we can do to improve these messages so going to close this out.
raiseObjectCrudException(f"Validated save failed for Django object. Parameters: {parameters}") fromerror
The Django message "Interface with this Device and Name already exists" that clarifies why it failed is not included in the SSOT job or operations logs. That same Django message is shown when attempting to do the same invalid operation in the nautobot web interface, but not shown in SSOT.
Environment
Proposed Functionality
In ssot.contrib, when creating/updating an object with data that fails the various validation constraints, the message "Validated save failed for Django object. Parameters: {.......}" is logged.
It would be more helpful to also log the contents of the django ValidationError that is raised, to give a hint of what went wrong.
Example:
log
Validated save failed for Django object: Interface with this Device and Name already exists. Parameters: {'name': 'port-channel12', 'device__name': 'xyz', 'description': 'something', 'enabled': True, 'type': 'other', 'mode': 'tagged', 'status__name': 'Active', 'lag__name': None, 'lag__device__name': None, 'untagged_vlan__vid': 33, 'untagged_vlan__name': 'foobar-dhcp', 'tagged_vlans': [{'vid': 33, 'name': 'foobar-dhcp'}, {'vid': 99, 'name': 'foobar-baz'}], 'trunk_groups': [], 'mgmt_only': False, 'vrf__name': None, 'vrf__namespace__name': None}
instead of
Validated save failed for Django object. Parameters: {'name': 'port-channel12', 'device__name': 'xyz', 'description': 'something', 'enabled': True, 'type': 'other', 'mode': 'tagged', 'status__name': 'Active', 'lag__name': None, 'lag__device__name': None, 'untagged_vlan__vid': 33, 'untagged_vlan__name': 'foobar-dhcp', 'tagged_vlans': [{'vid': 33, 'name': 'foobar-dhcp'}, {'vid': 99, 'name': 'foobar-baz'}], 'trunk_groups': [], 'mgmt_only': False, 'vrf__name': None, 'vrf__namespace__name': None}
(this one left me puzzled for a while since there were 14 parameters to check. It turned out I already had "Port-Channel12" and was trying to create "port-channel12")
Use Case
Easier troubleshooting of error messages
The text was updated successfully, but these errors were encountered: