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

Lost all saved managed files after upgrade to 3.0

      Upgraded Jenkins from 2.140 to 2.141 and in the same time config-file-provider-plugin from 2.18 to 3.0 

      After Jenkins restart, all configured files were gone.

      Jenkins shows warning about unreadable data:

      The first one is generic:

      org.jenkinsci.plugins.configfiles.GlobalConfigFiles Managed files ConversionException: org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1 : org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1 ---- Debugging information ---- message : org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1 cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1 class : java.util.TreeSet required-type : java.util.TreeSet converter-type : com.thoughtworks.xstream.converters.collections.TreeSetConverter path : /org.jenkinsci.plugins.configfiles.GlobalConfigFiles/configs/comparator line number : 4 -------------------------------, MissingFieldException: No field 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig' found in class 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles', MissingFieldException: No field 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig' found in class 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles', MissingFieldException: No field 'org.jenkinsci.plugins.configfiles.maven.MavenToolchainsConfig' found in class 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles', MissingFieldException: No field 'org.jenkinsci.plugins.configfiles.maven.MavenToolchainsConfig' found in class 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles'

       

      The second one is specific to one Jenkins Job folder, where there should be no such configuration at all.

      com.cloudbees.hudson.plugins.folder.Folder releng+target ConversionException: org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1 : org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1 ---- Debugging information ---- message : org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1 cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1 class : java.util.TreeSet required-type : java.util.TreeSet converter-type : com.thoughtworks.xstream.converters.collections.TreeSetConverter path : /com.cloudbees.hudson.plugins.folder.Folder/properties/org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty/configs/comparator line number : 13 -------------------------------, ConversionException: Could not call org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty.readResolve() : null : Could not call org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty.readResolve() : null ---- Debugging information ---- message : Could not call org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty.readResolve() : null cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException cause-message : Could not call org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty.readResolve() : null class : org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty required-type : java.util.TreeSet converter-type : hudson.util.RobustReflectionConverter path : /com.cloudbees.hudson.plugins.folder.Folder/properties/org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty/configs line number : 14 -------------------------------

       

      Now I don't know if this version is expected to break all stored provided files (the version number change could suggest it). If it is, then there should be a strong warning at the Jenkins plugin page stating that it is incompatible with the old version.

      Otherwise, please fix the problem  Thanks.

          [JENKINS-53399] Lost all saved managed files after upgrade to 3.0

          Is it safe to update from 3.0 to 3.1? What's the exact procedure to avoid another disaster?

          Update and change 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles.xml' or viceversa?

          Giacomo Boccardo added a comment - Is it safe to update from 3.0 to 3.1? What's the exact procedure to avoid another disaster? Update and change 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles.xml' or viceversa?

          Dominik Bartholdi added a comment - jhack please see my comment above...  https://issues.jenkins-ci.org/browse/JENKINS-53399?focusedCommentId=348653&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-348653

          domi I read it, so I asked those questions.

          Giacomo Boccardo added a comment - domi I read it, so I asked those questions.

          if you have 3.0 installed (and it is working), then do this:

          upgrade to 3.1 and in the file 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles.xml' (only one file) you have to change

          <comparator class="org.jenkinsci.plugins.configfiles.ConfigComparator"/> back to: <comparator class="org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1"/>

          and in the folder config.xml's (potentially multiple files) you have to change 

          <comparator class="org.jenkinsci.plugins.configfiles.ConfigComparator"/> back to: <comparator class="org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1"/>

          Dominik Bartholdi added a comment - if you have 3.0 installed (and it is working), then do this: upgrade to 3.1 and in the file 'org.jenkinsci.plugins.configfiles.GlobalConfigFiles.xml' (only one file) you have to change <comparator class="org.jenkinsci.plugins.configfiles.ConfigComparator"/>  back to: <comparator  class="org.jenkinsci.plugins.configfiles.GlobalConfigFiles$1"/> and in the folder config.xml's (potentially multiple files) you have to change  <comparator class="org.jenkinsci.plugins.configfiles.ConfigComparator"/>  back to: <comparator  class="org.jenkinsci.plugins.configfiles.folder.FolderConfigFileProperty$1"/>

          Oleg Nenashev added a comment -

          It would be possible to retain the class introduced in 3.0 and then do some migration to it via readResolve() on the Tree level (replace the Tree instance when pre-3.0 configuration is being read). It would keep pre-3.0 instances compatible and allow migrating to the new data structure as it was intended.

           

           

          Oleg Nenashev added a comment - It would be possible to retain the class introduced in 3.0 and then do some migration to it via readResolve() on the Tree level (replace the Tree instance when pre-3.0 configuration is being read). It would keep pre-3.0 instances compatible and allow migrating to the new data structure as it was intended.    

          thanks Oleg, I can take look at this in the future, but for now this is released again with the 2.18 implementation

          Dominik Bartholdi added a comment - thanks Oleg, I can take look at this in the future, but for now this is released again with the 2.18 implementation

          3.1 fix the issue for me, thanks!

          Cyprien Devillez added a comment - 3.1 fix the issue for me, thanks!

          Jens Beyer added a comment -

          Upgraded from 2.18 to 3.1, had no issues so far. No unreadable data reported. Builds running. Thanks for your quick work.

          What's the workflow now, do I have to set the status of the issue to something or are you devs doing it?

          Jens Beyer added a comment - Upgraded from 2.18 to 3.1, had no issues so far. No unreadable data reported. Builds running. Thanks for your quick work. What's the workflow now, do I have to set the status of the issue to something or are you devs doing it?

          Dominik Bartholdi added a comment - - edited

          thanks beyerj - i'll resolve it... fixed with 3.1

          Dominik Bartholdi added a comment - - edited thanks beyerj - i'll resolve it... fixed with 3.1

          René Scheibe added a comment -

          With pull-request #69 the anonymous class serialization warnings are now fixed while maintaining XStream backward compatibility.

          René Scheibe added a comment - With pull-request #69 the anonymous class serialization warnings are now fixed while maintaining XStream backward compatibility.

            domi Dominik Bartholdi
            beyerj Jens Beyer
            Votes:
            8 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved: