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

Cannot save configurations for user under certain circumstances.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Any.

      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

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

              Created:
              Updated:
              Resolved: