-
Bug
-
Resolution: Fixed
-
Minor
-
None
I was using snakeyaml 1.29.1 and jenkins 2.319.2, we have several pipelines that are parsing yaml files and processing and they are using readYaml (https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#readyaml-read-yaml-from-files-in-the-workspace-or-text ) from the pipeline utility steps plugins, which in-turn uses snakeyaml plugin. After upgrading the jenkins to 2.375.4 and several plugins, I started seeing the following exception in my pipelines. The jenkins that I am using is running as a pod inside a k8s environment. infact its a statefulset. This is a linux environment.
Jenkins: 2.375.4
OS: Linux - 4.15.0-193-generic
Java: 11.0.18 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
The plugins of interest that I have upgraded are
pipeline utility steps: 2.15.1 from 2.11.0
snakeyaml-api:1.33-95.va_b_a_e3e47b_fa_4 from 1.29.1
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9 from 5.12.2-193.v26a_6078f65a_9
I see there is a dependency on snakeyaml >=1.33-90.v80dcb_3814d35 for pipeline-utility-steps and kubernetes-client-api plugins. hence I can't backout the snakeyaml by itself to 1.29.1 without backing out the other 2 plugins (kubernetes-client-api and pipeline-utility-steps), due to some of the vulnerabilities showing I don't want to back those plugins.
Following 2 plugins depend of the snakeyaml.
kubernetes-client-api:6.4.1-215.v2ed17097a_8e9 depends on snakeyaml-api:1.33-90.v80dcb_3814d35
pipeline-utility-steps:2.15.1 depends on snakeyaml-api:1.33-90.v80dcb_3814d35
Seems like there is some limit set in this new version of the plugin, which i am uncertain if can be configured. if so appreciate some insight.
org.yaml.snakeyaml.error.YAMLException: The incoming YAML document exceeds the limit: 3145728 code points. at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:342) at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:263) at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:662) at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:185) at org.yaml.snakeyaml.comments.CommentEventsCollector$1.peek(CommentEventsCollector.java:57) at org.yaml.snakeyaml.comments.CommentEventsCollector$1.peek(CommentEventsCollector.java:43) at org.yaml.snakeyaml.comments.CommentEventsCollector.collectEvents(CommentEventsCollector.java:136) at org.yaml.snakeyaml.comments.CommentEventsCollector.collectEvents(CommentEventsCollector.java:116) at org.yaml.snakeyaml.composer.Composer.composeScalarNode(Composer.java:239) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:208) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:357) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:336) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:311) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:212) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:357) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:336) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:311) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:212) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:357) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:336) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:311) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:212) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:357) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:336) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:311) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:212) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:357) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:336) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:311) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:212) at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:357) at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:336) at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:311) at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:212) at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:134) at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:168) at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:499) at org.jenkinsci.plugins.pipeline.utility.steps.conf.ReadYamlStep$Execution.doRun(ReadYamlStep.java:204) at org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileOrTextStepExecution.run(AbstractFileOrTextStepExecution.java:29) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Finished: FAILURE