salopensource / sal-scripts

Apache License 2.0
23 stars 31 forks source link

Fix for ValueError: Circular reference detected #90

Closed johnmikee closed 3 years ago

johnmikee commented 4 years ago

Maybe there is a better way to handle this before getting to save_results but 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.

johnmikee commented 3 years ago

@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.

Zolotkey commented 3 years ago

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:

  1. Install munki-facts.py into /usr/local/munki/conditions/
  2. run managedsoftwareupdate --munkipkgsonly
  3. run /usr/local/sal/checkin_modules/munki_checkin.py Issue Shows Up

Repair the checkin

  1. I removed munki-facts.py from munki conditions
  2. Ran managedsoftwareupdate --munkipkgsonly
  3. run /usr/local/sal/checkin_modules/munki_checkin.py Issue goes away
Zolotkey commented 3 years ago

This fixed my issue. I used @sheagcraig tweak of merging the two lines in my pkg.

johnmikee commented 3 years ago

Im going to close this. I think https://github.com/salopensource/sal-scripts/pull/91 is a better solution.