Fix for ValueError: Circular reference detected#90
Fix for ValueError: Circular reference detected#90johnmikee wants to merge 6 commits intosalopensource:mainfrom
Conversation
|
@sheagcraig based off your idea I updated this. Maybe another attempt should be made to serialize it but I think if its logged that its being dropped it should be fine. |
|
I just got this same error myself. I recently just added Munki-Facts to my deployment, and noticed the next sal/munki run the error came up. In my troubleshooting I was able to do the following. Reproduced the issue:
Repair the checkin
|
sal_python_pkg/sal/utils.py
Outdated
| # Make sure everything has been set to offset 0 / UTC time. | ||
| obj = obj.astimezone(datetime.timezone.utc).isoformat() | ||
| return obj | ||
| return obj |
There was a problem hiding this comment.
I would just compact the two lines here into return obj.astimezone...
There was a problem hiding this comment.
Removed the redundant obj lines. If you want me to change anything else let me know.
|
This fixed my issue. I used @sheagcraig tweak of merging the two lines in my pkg. |
|
Im going to close this. I think #91 is a better solution. |
Maybe there is a better way to handle this before getting to
save_resultsbut from testing this works.I'm assuming the circular error is because the object passed to the serializer was returned back the same, not serialized, which was confusing to me since the circle is between the object and itself (I think).
Hopefully raising the TypeError for anything else that fails will prevent this from tripping things up.