AristaAvdDuplicateDataError message replaced by a TypeError under ansible-core 2.19+ (real conflict hidden)
#7162
Unanswered
shoddynetwork
asked this question in
Q&A
Replies: 1 comment 6 replies
|
ugh thats not supposed to happen can you pinpoint the line with this? We have not seen this one before and we have some extensive testing of negative issues (including duplicates) using ansible 2.19. Can you share some repro inputs maybe? Though thanks for reporting! |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
On a build with a genuine duplicate in the data model, the useful
Found duplicate objects with conflicting data… {A} conflicts with {B}message never reaches us — it's replaced by a constructorTypeError, so we can't see what actually conflicts. The cause looks like exception reconstruction in ansible-core 2.19+: AVD exceptions store only(message,)inException.args(viaAristaAvdError.__init__), butAristaAvdDuplicateDataError.__init__(context, context_item_a, context_item_b, host=None)needs three positional args, so when core rebuilds the chained exception viatype(exc)(*exc.args)it raisesmissing 2 required positional arguments. We only recovered the real conflict by temporarily patching the exception constructor to dumpself.messageto a file. Is this a known interaction, and would makingAristaAvdErrorsubclasses reconstructable (e.g. a base__reduce__) be the right fix? Happy to open an issue/PR if useful.What we see:
What was actually being reported (recovered via the patch):
Environment: pyavd 6.2.0 · arista.avd 6.2.0 · ansible-core 2.20.5 · Python 3.12
All reactions