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

Cannot save configurations for user under certain circumstances.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Any.
    • Similar Issues:

      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

          Hide
          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

          Show
          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
          Hide
          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
          Show
          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
          Hide
          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

          Show
          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

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

              Dates

              • Created:
                Updated:
                Resolved: