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

1.280+LDAP saves 279K lines in config.xml, fail to load on restart

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • _unsorted
    • None
    • Platform: All, OS: All

      r14875 (which says "doc improvements"?!) added ldapTemplate in
      LDAPSecurityRealm.. next time I saved my top-level Hudson config (which already
      used LDAP), my config.xml became 279684 lines long! Nearly all of this is the
      <ldapTemplate> item under the LDAP setting. On my next Hudson restart, it fails
      when trying to load config.xml.

      (B[02/Feb/2009:11:00:03] failure (22635): Failed to initialize Hudson
      java.lang.Error: hudson.util.IOException2: Unable to read /path/to/hudson/config.xml
      at hudson.WebAppMain$2.run(WebAppMain.java:162)
      Caused by: hudson.util.IOException2: Unable to read /path/to/hudson/config.xml
      at hudson.XmlFile.unmarshal(XmlFile.java:127)
      at hudson.model.Hudson.load(Hudson.java:1660)
      at hudson.model.Hudson.<init>(Hudson.java:457)
      at hudson.WebAppMain$2.run(WebAppMain.java:160)
      Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not
      call java.security.CodeSource.readObject() : null
      ---- Debugging information ----
      message : Could not call java.security.CodeSource.readObject()
      cause-exception : java.lang.RuntimeException
      cause-message : null
      class : hudson.model.Hudson
      required-type : java.security.CodeSource
      path :
      /hudson/securityRealm/ldapTemplate/dirContextFactory/messages/messageSource/classLoader/parent/domains/java.security.ProtectionDomain/codesource/java.security.CodeSource
      line number : 6022
      -------------------------------
      at
      com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadObject(SerializationMethodInvoker.java:89)
      at
      com.thoughtworks.xstream.converters.reflection.SerializableConverter.doUnmarshal(SerializableConverter.java:386)
      at
      com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:150)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
      at
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:55)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
      at
      hudson.util.RobustReflectionConverter.unmarshallField(RobustReflectionConverter.java:234)
      at
      hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:194)
      at
      hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:145)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
      at
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:55)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
      at
      com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:77)
      at
      hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:55)
      at
      com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
      at
      hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:47)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
      at
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:55)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
      at
      hudson.util.RobustReflectionConverter.unmarshallField(RobustReflectionConverter.java:234)
      at
      hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:194)
      at
      hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:145)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
      at
      com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:55)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
      at
      com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
      at
      hudson.util.RobustReflectionConverter.unmarshallField(RobustReflectionConverter.java:234)
      at

          [JENKINS-2958] 1.280+LDAP saves 279K lines in config.xml, fail to load on restart

          Alan Harder added a comment -

          Making LDAPSecurityRealm.ldapTemplate field transient to fix this. However, if
          you use 1.280+LDAP and have already saved your top level config then you'll need
          to manually edit config.xml to remove the <ldapTemplate>....</ldapTemplate>
          section (if, like me, your Hudson fails to start once this has been added).

          Alan Harder added a comment - Making LDAPSecurityRealm.ldapTemplate field transient to fix this. However, if you use 1.280+LDAP and have already saved your top level config then you'll need to manually edit config.xml to remove the <ldapTemplate>....</ldapTemplate> section (if, like me, your Hudson fails to start once this has been added).

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/security/LDAPSecurityRealm.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=15003
          Log:
          [FIXED JENKINS-2958] Make LDAPSecurityRealm.ldapTemplate field transient
          so ~279K lines are not written to config.xml

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/security/LDAPSecurityRealm.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=15003 Log: [FIXED JENKINS-2958] Make LDAPSecurityRealm.ldapTemplate field transient so ~279K lines are not written to config.xml

          I'm really sorry I missed this.

          I'll add a test case to prevent this from happening again.

          Kohsuke Kawaguchi added a comment - I'm really sorry I missed this. I'll add a test case to prevent this from happening again.

          Alan Harder added a comment -
              • Issue 2972 has been marked as a duplicate of this issue. ***

          Alan Harder added a comment - Issue 2972 has been marked as a duplicate of this issue. ***

            mindless Alan Harder
            mindless Alan Harder
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: