Skip to content

Fix for ValueError: Circular reference detected#90

Closed
johnmikee wants to merge 6 commits intosalopensource:mainfrom
johnmikee:main
Closed

Fix for ValueError: Circular reference detected#90
johnmikee wants to merge 6 commits intosalopensource:mainfrom
johnmikee:main

Conversation

@johnmikee
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor Author

@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
Copy link
Copy Markdown
Contributor

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

# Make sure everything has been set to offset 0 / UTC time.
obj = obj.astimezone(datetime.timezone.utc).isoformat()
return obj
return obj
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just compact the two lines here into return obj.astimezone...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the redundant obj lines. If you want me to change anything else let me know.

@Zolotkey
Copy link
Copy Markdown
Contributor

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

@johnmikee
Copy link
Copy Markdown
Contributor Author

Im going to close this. I think #91 is a better solution.

@johnmikee johnmikee closed this Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants