Skip to content

[JENKINS-47416] Views deleted by upgrade from cloudbees-folders 6.1.2 to 6.2.0 #22363

Closed

Description

@jenkins-infra-bot

When I installed cloudbees-folder-plugin 6.2.0, the views defined in several of my folders were deleted.

An administrative monitor appeared warning about unreadable data. The message was:

ConversionException: Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() :
no parent set on com.cloudbees.hudson.plugins.folder.Folder[null] :
Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() :
no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
---- Debugging information ----
message : Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() : no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message : Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() : no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
class : com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder required-type : com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder
converter-type : hudson.util.RobustReflectionConverter path
: /com.cloudbees.hudson.plugins.folder.Folder/folderViews line number : 157 -------------------------------

To duplicate the problem:

  1. Clone, build, and run the docker instance
      $ git lfs clone https://github.com/MarkEWaite/docker-lfs JENKINS-47416
      $ cd JENKINS-47416
      $ git lfs fetch origin JENKINS-47416
      $ git checkout -b lts-with-plugins JENKINS-47416
      $ docker build -t jenkins:JENKINS-47416 .
      $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-47416
    
  2. <li>Click "Manage Jenkins"</li>
    <li>Clck the "Manage" button to the right of "You have data stored in an older format and/or unreadable data" (opens <a href="http://localhost:8080/administrativeMonitor/OldData/manage" class="external-link" target="_blank" rel="nofollow noopener">http://localhost:8080/administrativeMonitor/OldData/manage</a> )</li>
    

One of the folder config.xml files is available in the docker image

Conversion exception is thrown even if I update the folder definition to 6.1.2 format before upgrading the cloudbees-folders plugin.


Originally reported by markewaite, imported from: Views deleted by upgrade from cloudbees-folders 6.1.2 to 6.2.0
  • assignee: jglick
  • status: Closed
  • priority: Major
  • component(s): cloudbees-folder-plugin, core
  • label(s): regression
  • resolution: Fixed
  • resolved: 2017-10-17T13:16:09+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

When I installed cloudbees-folder-plugin 6.2.0, the views defined in several of my folders were deleted.

An administrative monitor appeared warning about unreadable data. The message was:

ConversionException: Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() :
no parent set on com.cloudbees.hudson.plugins.folder.Folder[null] :
Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() :
no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
---- Debugging information ----
message : Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() : no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message : Could not call com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve() : no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
class : com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder required-type : com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder
converter-type : hudson.util.RobustReflectionConverter path
: /com.cloudbees.hudson.plugins.folder.Folder/folderViews line number : 157 -------------------------------

To duplicate the problem:

  1. Clone, build, and run the docker instance
      $ git lfs clone https://github.com/MarkEWaite/docker-lfs JENKINS-47416
      $ cd JENKINS-47416
      $ git lfs fetch origin JENKINS-47416
      $ git checkout -b lts-with-plugins JENKINS-47416
      $ docker build -t jenkins:JENKINS-47416 .
      $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-47416
    
  2. Click "Manage Jenkins"
  3. Clck the "Manage" button to the right of "You have data stored in an older format and/or unreadable data" (opens http://localhost:8080/administrativeMonitor/OldData/manage )

One of the folder config.xml files is available in the docker image

Conversion exception is thrown even if I update the folder definition to 6.1.2 format before upgrading the cloudbees-folders plugin.

environment
Docker image running Jenkins 2.73.2<br/>
cloudbees-folder-plugin 6.2.0<br/>
upgrading folders from prior cloudbees-folder-plugin<br/>

Activity

  1. jenkins-infra-bot commented on Oct 12, 2017

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Oct 15, 2017

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      Will try to reproduce. My guesses offhand:

      • stephenconnolly did not have test coverage for the original readResolve
      • and the original catch of InvocationTargetException masked an original bug

      To the second point, the principle I always take is that when calling a method reflectively which might not yet exist, catch NoSuchMethodException and ignore, but log anything else as a warning.

    Will try to reproduce. My guesses offhand:

    • stephenconnolly did not have test coverage for the original readResolve
    • and the original catch of InvocationTargetException masked an original bug

    To the second point, the principle I always take is that when calling a method reflectively which might not yet exist, catch NoSuchMethodException and ignore, but log anything else as a warning.

  3. jenkins-infra-bot commented on Oct 15, 2017

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:
      java.lang.IllegalStateException: no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
      	at hudson.model.AbstractItem.getParent(AbstractItem.java:206)
      	at hudson.model.AbstractItem.getShortUrl(AbstractItem.java:473)
      	at hudson.model.AbstractItem.getUrl(AbstractItem.java:435)
      	at hudson.model.AllView.migrateLegacyPrimaryAllViewLocalizedName(AllView.java:167)
      	at com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve(DefaultFolderViewHolder.java:134)
      

      Guessed right on both counts. The call to migrateLegacyPrimaryAllViewLocalizedName never worked, due to a misplaced attempt to call getUrl in a log message; but this was never noticed because there was no test coverage for the call; and the error was being thrown on every startup for a long time, but then ignored.

    java.lang.IllegalStateException: no parent set on com.cloudbees.hudson.plugins.folder.Folder[null]
    	at hudson.model.AbstractItem.getParent(AbstractItem.java:206)
    	at hudson.model.AbstractItem.getShortUrl(AbstractItem.java:473)
    	at hudson.model.AbstractItem.getUrl(AbstractItem.java:435)
    	at hudson.model.AllView.migrateLegacyPrimaryAllViewLocalizedName(AllView.java:167)
    	at com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder.readResolve(DefaultFolderViewHolder.java:134)
    

    Guessed right on both counts. The call to migrateLegacyPrimaryAllViewLocalizedName never worked, due to a misplaced attempt to call getUrl in a log message; but this was never noticed because there was no test coverage for the call; and the error was being thrown on every startup for a long time, but then ignored.

  4. jenkins-infra-bot commented on Oct 15, 2017

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      Thanks markewaite for discovering so promptly and providing exact steps to reproduce!

    Thanks markewaite for discovering so promptly and providing exact steps to reproduce!

  5. jenkins-infra-bot commented on Oct 16, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java src/test/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolderTest.java src/test/resources/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolderTest/oldData/jobs/d/config.xml http://jenkins-ci.org/commit/cloudbees-folder-plugin/dd19bff08faba7f49c8da9deea7680f731520dea Log: JENKINS-47416 Use a patched copy of the core API for now.

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java
    src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java
    src/test/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolderTest.java
    src/test/resources/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolderTest/oldData/jobs/d/config.xml
    http://jenkins-ci.org/commit/cloudbees-folder-plugin/dd19bff08faba7f49c8da9deea7680f731520dea
    Log:
    JENKINS-47416 Use a patched copy of the core API for now.

  6. jenkins-infra-bot commented on Oct 16, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java
    src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java
    src/test/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolderTest.java
    src/test/resources/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolderTest/oldData/jobs/d/config.xml
    http://jenkins-ci.org/commit/cloudbees-folder-plugin/e491ee80db9a0a8738b2b59a4ffee2623a56c283
    Log:
    Merge pull request #114 from jglick/JENKINS-47416

    JENKINS-47416 Use a patched copy of the core API for now

    Compare: jenkinsci/cloudbees-folder-plugin@9b3018f...e491ee8

  7. jenkins-infra-bot commented on Oct 17, 2017

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      Core fix merged towards 2.86; plugin workaround released as 6.2.1.

    Core fix merged towards 2.86; plugin workaround released as 6.2.1.

  8. jenkins-infra-bot commented on Oct 17, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    core/src/main/java/hudson/model/AllView.java
    http://jenkins-ci.org/commit/jenkins/6a2e907e7d4c00ae673a054cc3c65feb24f559de
    Log:
    JENKINS-47416 ViewGroup.getUrl could throw NPE during deserialization, so do not call it from migrateLegacyPrimaryAllViewLocalizedName.

  9. jenkins-infra-bot commented on Oct 17, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    core/src/main/java/hudson/model/AllView.java
    http://jenkins-ci.org/commit/jenkins/8ac33fdecea0dfe92450594dadac799e4b3b1f2d
    Log:
    Merge pull request #3088 from jglick/JENKINS-47416

    JENKINS-47416 Do not call ViewGroup.getUrl from migrateLegacyPrimaryAllViewLocalizedName

    Compare: 3be716b...8ac33fd

  10. jenkins-infra-bot commented on Oct 17, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/java/com/cloudbees/hudson/plugins/folder/views/DefaultFolderViewHolder.java
    http://jenkins-ci.org/commit/cloudbees-folder-plugin/cbde5251843625f389f4be956d0e9d4d3055516c
    Log:
    Noting merge of JENKINS-47416.

  11. jenkins-infra-bot commented on Oct 17, 2017

    @jenkins-infra-bot
    Author
    markewaite:
    • Original comment link
    • Raw content of original comment:

      Verified fixed in folders 6.2.1

    Verified fixed in folders 6.2.1

  12. jenkins-infra-bot commented on Oct 23, 2017

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      Regarding lts-candidate status: the fix should be harmless (it is hard to see how it could cause any regression); OTOH it is not very important, as it only affects users of cloudbees-folder 6.2.0. Having the fix backported to 2.73.3 would make it possible to remove the plugin workaround a little earlier, that is all.

    Regarding lts-candidate status: the fix should be harmless (it is hard to see how it could cause any regression); OTOH it is not very important, as it only affects users of cloudbees-folder 6.2.0. Having the fix backported to 2.73.3 would make it possible to remove the plugin workaround a little earlier, that is all.

  13. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions