-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot load yaml data coming from Ansible: Number of aliases for non-scalar nodes exceeds the specified max=50 #390
Comments
Modifying the java code to set maxAliasesForCollections to an higher value (like 1000) seems to fix the problem. But I keep having java.lang.NullPointerException like in rundeck/rundeck#9278 (comment) |
i had to do the same in #388 |
Hi @tpegeot |
Hi @ltamaster, Here is a version of our inventory that produces the issue :
Thanks, |
@ltamaster , ldimaur0 uploaded our inventory. As mentioned earlier, setting maxAliasesForCollections to an higher value (like 1000) fixes the "Number of aliases for non-scalar nodes exceeds the specified max=50" problem. However, we've not been able to fix the "null exception" error. We tried #388 but it didn't help. |
@tpegeot ,could you share where we need to modify this value please ? |
In src/main/groovy/com/rundeck/plugins/ansible/plugin/AnsibleResourceModelSource.java, I modified the ansibleInventoryList function :
|
Hello,
I'm linking the issue rundeck/rundeck#9278 here as it seems related to the Ansible-plugin.
Describe the bug
I'm not able to load my Ansible inventory in Rundeck because of the following error :
[2024-09-26T08:46:25,397] ERROR resources.ExceptionCatchingResourceModelSource [NodeService-SourceLoader1] - [ResourceModelSource: 2.source (com.batix.rundeck.plugins.AnsibleResourceModelSourceFactory), project: Security_updates] com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Cannot load yaml data coming from Ansible: Number of aliases for non-scalar nodes exceeds the specified max=50
Possible root cause
The amount of aliases for collections is set to 50 by default to avoid https://en.wikipedia.org/wiki/Billion_laughs_attack
See https://javadoc.io/static/org.yaml/snakeyaml/1.32/org/yaml/snakeyaml/LoaderOptions.html#setMaxAliasesForCollections-int-
Possible solution
I'm wondering if it would be possible to add a call to the setMaxAliasesForCollections function in ansible-plugin/src/main/groovy/com/rundeck/plugins/ansible/plugin/AnsibleResourceModelSource.java file in order to increase the default limit?
Thank you in advance
Thomas
The text was updated successfully, but these errors were encountered: