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

MyViewsProperty support for configuration-as-code

    XMLWordPrintable

Details

    • 2.344

    Description

      When applying a configuration, a NPE is raised because of the MyViewsProperty class.

      java.lang.NullPointerException
      	at hudson.model.MyViewsProperty.save(MyViewsProperty.java:138)
      	at hudson.BulkChange.commit(BulkChange.java:98)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:271)
      	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
      	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
      	at io.vavr.control.Option.map(Option.java:392)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
      	at io.vavr.Tuple2.apply(Tuple2.java:238)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:55)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
      	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
      	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
      	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
      	at io.vavr.control.Option.map(Option.java:392)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
      	at io.vavr.Tuple2.apply(Tuple2.java:238)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:352)
      	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
      

      Looks similar to https://github.com/jenkinsci/jenkins/pull/4557

       

      An example configuration:

      jenkins:
        securityRealm:
          local:
            allowsSignup: false
            enableCaptcha: false
            users:
            - id: "admin"
              name: "admin"
              properties:
              - "apiToken"
              - "myView"
              - preferredProvider:
                  providerId: "default"
              - "timezone"
      

      Attachments

        Activity

          egutierrez Evaristo Gutierrez created issue -
          egutierrez Evaristo Gutierrez added a comment - CC timja
          oleg_nenashev Oleg Nenashev made changes -
          Field Original Value New Value
          Component/s core [ 15593 ]
          Component/s configuration-as-code-plugin [ 23170 ]
          oleg_nenashev Oleg Nenashev made changes -
          Assignee Ewelina Wilkosz [ ewel ]
          oleg_nenashev Oleg Nenashev made changes -
          Labels jcasc-compatibility
          timja Tim Jacomb added a comment -

          What’s the configuration being applied?

          timja Tim Jacomb added a comment - What’s the configuration being applied?
          egutierrez Evaristo Gutierrez made changes -
          Description When applying a configuration, a NPE is raised because of the MyViewsProperty class.
          {code:java}
          java.lang.NullPointerException
          at hudson.model.MyViewsProperty.save(MyViewsProperty.java:138)
          at hudson.BulkChange.commit(BulkChange.java:98)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:271)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
          at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
          at io.vavr.control.Option.map(Option.java:392)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
          at io.vavr.Tuple2.apply(Tuple2.java:238)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:55)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
          at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
          at io.vavr.control.Option.map(Option.java:392)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
          at io.vavr.Tuple2.apply(Tuple2.java:238)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:352)
          at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
          {code}
          Looks similar to [https://github.com/jenkinsci/jenkins/pull/4557]
          When applying a configuration, a NPE is raised because of the MyViewsProperty class.
          {code:java}
          java.lang.NullPointerException
          at hudson.model.MyViewsProperty.save(MyViewsProperty.java:138)
          at hudson.BulkChange.commit(BulkChange.java:98)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:271)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
          at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
          at io.vavr.control.Option.map(Option.java:392)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
          at io.vavr.Tuple2.apply(Tuple2.java:238)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:55)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
          at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
          at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
          at io.vavr.control.Option.map(Option.java:392)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
          at io.vavr.Tuple2.apply(Tuple2.java:238)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
          at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
          at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:352)
          at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
          {code}
          Looks similar to [https://github.com/jenkinsci/jenkins/pull/4557]

           

          An example configuration:
          {code:java}
          jenkins:
            securityRealm:
              local:
                allowsSignup: false
                enableCaptcha: false
                users:
                - id: "admin"
                  name: "admin"
                  properties:
                  - "apiToken"
                  - "myView"
                  - preferredProvider:
                      providerId: "default"
                  - "timezone"
          {code}

          timja sorry, I have added it to the description.

          egutierrez Evaristo Gutierrez added a comment - timja sorry, I have added it to the description.
          timja Tim Jacomb made changes -
          Summary NPE when saving MyViewsProperty MyViewsProperty support for configuration-as-code
          timja Tim Jacomb made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          ealvarez Esther Álvarez Feijoo made changes -
          Assignee Esther Álvarez Feijoo [ ealvarez ]
          paprzyx Piotr added a comment -

          egutierrez Did you found any solution for that? I have same problem.

          paprzyx Piotr added a comment - egutierrez  Did you found any solution for that? I have same problem.
          paprzyx Piotr added a comment -

          egutierrez for workaround jsut remove myView from configuration

          paprzyx Piotr added a comment - egutierrez  for workaround jsut remove  myView from configuration
          stanislaw_kodzis Stanisław added a comment -

          This is still not solved, and very annoying. Workaround for Piotr works fine, however

          stanislaw_kodzis Stanisław added a comment - This is still not solved, and very annoying. Workaround for Piotr works fine, however
          stanislaw_kodzis Stanisław made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          stanislaw_kodzis Stanisław made changes -
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          timja Tim Jacomb made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          timja Tim Jacomb made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          timja Tim Jacomb made changes -
          Remote Link This issue links to "https://github.com/jenkinsci/jenkins/pull/6202 (Web Link)" [ 27363 ]
          timja Tim Jacomb made changes -
          Assignee Esther Álvarez Feijoo [ ealvarez ] Tim Jacomb [ timja ]
          basil Basil Crow made changes -
          Released As 2.344
          Resolution Fixed [ 1 ]
          Status In Review [ 10005 ] Fixed but Unreleased [ 10203 ]
          basil Basil Crow made changes -
          Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
          basil Basil Crow added a comment -

          Fixed in 2.344. paprzyx stanislaw_kodzis Can you please verify that the issue has been resolved? Thanks!

          basil Basil Crow added a comment - Fixed in 2.344. paprzyx stanislaw_kodzis Can you please verify that the issue has been resolved? Thanks!
          basil Basil Crow made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          People

            timja Tim Jacomb
            egutierrez Evaristo Gutierrez
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: