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

Cannot save configurations for user under certain circumstances.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None
    • Any.

    Description

      Due to change:

      c19867326551e3a3e711 => https://github.com/jenkinsci/jenkins/commit/c19867326551e3a3e711bfbb5e32c48c48257e02

      ...user configurations cannot any longer be saved correctly on certain Jenkins installations. When the user configuration is not saved/submitted correctly, the user cannot access private views anymore.

      Due to this added check: +<j:if test="${d.enabled}">
      certain (disabled) properties are skipped which generates post data similar to this one:

      {"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@comain.com"}, "userProperty2": {"primaryViewName": ""}}

      Please notice the absence of "userProperty1"

      After this data has been posted all user's private views just generate an error like this:

      javax.servlet.ServletException: java.lang.NullPointerException
              org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:597)
              org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
              org.kohsuke.stapler.MetaClass$7.doDispatch(MetaClass.java:242)
              org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
              org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562
             [cut]
      

      And the views cannot be accessed. Even more strange is that the user's config.xml contains this:

      <user>
        <fullName>myname</fullName>
        <properties>
          <hudson.tasks.Mailer_-UserProperty>
            <emailAddress></emailAddress>
          </hudson.tasks.Mailer_-UserProperty>
          <null/>
          <hudson.model.MyViewsProperty>
          [cut]
      

      Please notice the <null/>

      This is repeatable for every user in our system.

      Now for the reeeeaally strange part. If I temper the post data from this:

      {"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty2": {"primaryViewName": ""}}

      to look like this:

      {"fullName": "myname", "description": "", "userProperty0": {"address": "mymail@domain.com"}, "userProperty1": {"primaryViewName": ""}}

      The config is saved correctly and all private views becomes available again.
      Even more strange: in the future, the user will be able to resave the configuration without tempering with the post data, and everything will work fine - even though future post-data will look exactly like the original post data (userProperty2).

      It is of course a huge issue for us. Users cannot view their views until I form post tempered config data.

      We are using LDAP for authentication
      and view plugins like
      Favorites
      Nested views
      Dashboard
      Section view

      Best Regards
      Gustaf

      Attachments

        Activity

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/model/User.java
          test/src/test/java/hudson/model/UserPropertyTest.java
          test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly
          test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly
          http://jenkins-ci.org/commit/jenkins/29dc1d5fa8e684e27034f717eb820ff53cdb14ea
          Log:
          [FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins

          Compare: https://github.com/jenkinsci/jenkins/compare/36ddba6...29dc1d5

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/model/User.java test/src/test/java/hudson/model/UserPropertyTest.java test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly http://jenkins-ci.org/commit/jenkins/29dc1d5fa8e684e27034f717eb820ff53cdb14ea Log: [FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins Compare: https://github.com/jenkinsci/jenkins/compare/36ddba6...29dc1d5
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #608
          [FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins

          Kohsuke Kawaguchi : 29dc1d5fa8e684e27034f717eb820ff53cdb14ea
          Files :

          • core/src/main/java/hudson/model/User.java
          • test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly
          • test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly
          • test/src/test/java/hudson/model/UserPropertyTest.java
          • changelog.html
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #608 [FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins Kohsuke Kawaguchi : 29dc1d5fa8e684e27034f717eb820ff53cdb14ea Files : core/src/main/java/hudson/model/User.java test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly test/src/test/java/hudson/model/UserPropertyTest.java changelog.html

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/src/main/java/hudson/model/User.java
          test/src/test/java/hudson/model/UserPropertyTest.java
          test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly
          test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly
          http://jenkins-ci.org/commit/jenkins/29dc1d5fa8e684e27034f717eb820ff53cdb14ea
          Log:
          [FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/model/User.java test/src/test/java/hudson/model/UserPropertyTest.java test/src/test/resources/hudson/model/UserPropertyTest/UserProperty1/config.jelly test/src/test/resources/hudson/model/UserPropertyTest/UserProperty2/config.jelly http://jenkins-ci.org/commit/jenkins/29dc1d5fa8e684e27034f717eb820ff53cdb14ea Log: [FIXED JENKINS-9062] Fixed a bug in persisting user configuration that causes NPE in some plugins

          People

            kohsuke Kohsuke Kawaguchi
            glundh glundh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: