Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63272

"Incompatible element" with Strict Crumb Issuer and JCasC

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi, using the Jenkins Docker image (jenkins/jenkins:2.235.2), tried with configuration-as-code:1.41 or 1.42, and strict-crumb-issuer:2.1.0.

      If I add the following to my CasC YAML:

      jenkins:
        crumbIssuer:
          strict:
            checkSessionMatch: false
            hoursValid: 1
      

      and start up Jenkins, I get

      io.jenkins.plugins.casc.ConfiguratorException: Found incompatible configuration elements YamlSource: /etc/jenkins_casc/shared.yml  in /etc/jenkins_casc/shared.yml, line 12, column 5:
              strict:
              ^
           at io.jenkins.plugins.casc.yaml.YamlUtils.merge(YamlUtils.java:102)
           at io.jenkins.plugins.casc.yaml.YamlUtils.merge(YamlUtils.java:125)
           at io.jenkins.plugins.casc.yaml.YamlUtils.merge(YamlUtils.java:125)
           at io.jenkins.plugins.casc.yaml.YamlUtils.merge(YamlUtils.java:52)
      Caused: io.jenkins.plugins.casc.ConfiguratorException: Failed to read YamlSource: /etc/jenkins_casc/shared.yml
           at io.jenkins.plugins.casc.yaml.YamlUtils.merge(YamlUtils.java:56)
           at io.jenkins.plugins.casc.yaml.YamlUtils.loadFrom(YamlUtils.java:150)
           at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:616)
           at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:298)
           at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:290)
      Caused: java.lang.reflect.InvocationTargetException
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
      Caused: java.lang.Error
           at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
           at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
           at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
           at jenkins.model.Jenkins$5.runTask(Jenkins.java:1131)
           at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
           at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
           at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)

      When I start Jenkins up without that snippet, I can configure the plugin manually

      and view the CasC config, which is showing me I'm adding the snippet to my YAML correctly:

      Am aware of this previous issue - https://issues.jenkins-ci.org/browse/JENKINS-60523 - as well as this - https://github.com/jenkinsci/configuration-as-code-plugin/issues/1191 - which suggests everything should be working with these plugin versions, but unfortunately...

      (First time. Really hope I haven't been stupid anywhere. )

        Attachments

          Activity

          Hide
          wfollonier Wadeck Follonier added a comment -

          Nathan Costello Thanks for the report, I will have a look tomorrow-ish

          Show
          wfollonier Wadeck Follonier added a comment - Nathan Costello Thanks for the report, I will have a look tomorrow-ish
          Hide
          wfollonier Wadeck Follonier added a comment -

          Nathan Costello I tried to reproduce your case but was not able to. Even by including your portion of configuration into mine, it was working fine.

          Due to the stacktrace, I imagine it's due to your whole yaml and not this part in question.
          The code for your error is:

                  if (root.getNodeId() != node.getNodeId()) {
                      // means one of those yaml file doesn't conform to JCasC schema
                      throw new ConfiguratorException(
                              String.format("Found incompatible configuration elements %s %s", source, node.getStartMark()));
                  }
          

          So, are you including other file into a "shared" one (as supposed with your names) that does not respect the structure of the YAML files? Perhaps trying to get help on https://gitter.im/jenkinsci/configuration-as-code-plugin

          Show
          wfollonier Wadeck Follonier added a comment - Nathan Costello I tried to reproduce your case but was not able to. Even by including your portion of configuration into mine, it was working fine. Due to the stacktrace, I imagine it's due to your whole yaml and not this part in question. The code for your error is: if (root.getNodeId() != node.getNodeId()) { // means one of those yaml file doesn't conform to JCasC schema throw new ConfiguratorException( String .format( "Found incompatible configuration elements %s %s" , source, node.getStartMark())); } So, are you including other file into a "shared" one (as supposed with your names) that does not respect the structure of the YAML files? Perhaps trying to get help on https://gitter.im/jenkinsci/configuration-as-code-plugin
          Hide
          ncostello Nathan Costello added a comment -

          Hi Wadeck Follonier, thank you for taking a look at this! You pointed us in the right direction and yes, it turned out the base Docker image we were using also had a JCasC YAML in it that had a contradictory crumbIssuer setting already. 

          Show
          ncostello Nathan Costello added a comment - Hi Wadeck Follonier , thank you for taking a look at this! You pointed us in the right direction and yes, it turned out the base Docker image we were using also had a JCasC YAML in it that had a contradictory crumbIssuer setting already. 
          Hide
          wfollonier Wadeck Follonier added a comment -

          Nathan Costello perfect thank you for the answer, I will close this ticket as not-a-defect

          Show
          wfollonier Wadeck Follonier added a comment - Nathan Costello perfect thank you for the answer, I will close this ticket as not-a-defect

            People

            Assignee:
            wfollonier Wadeck Follonier
            Reporter:
            ncostello Nathan Costello
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: