kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.6k stars 83 forks source link

ConstructorError: found unconstructable recursive node #167

Closed 2rs2ts closed 8 months ago

2rs2ts commented 1 year ago

I have some YAML that's like this:

--- &1
foo: bar
recursive: *1

Trying to parse this at all (even using a filter as simple as .foo) raises the following error:

yq: Error running jq: ConstructorError: found unconstructable recursive node
  in "<stdin>", line 1, column 5.

I understand that it's sort of my fault that there is infinite recursion in my YAML, but I think that it would be good to be able to work around heavy recursion, including the infinite case, somehow. Perhaps a command line argument to set a maximum recursion depth?

kislyuk commented 1 year ago

Have you tried the --no-expand-aliases option?

kislyuk commented 8 months ago

Confirmed that the example cited works with --no-expand-aliases, closing.