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

Github Plugin configuration does not load after service restart

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor

      Whenever I restart the jenkins.service, the configuration for the github plugin fails to reload. the following exception is visible on the journal logs:

      2023-07-27 11:44:32.039+0000 [id=35]        WARNING        hudson.model.Descriptor#load: Failed to load /mnt/data/github-plugin-configuration.xml
      com.thoughtworks.xstream.mapper.CannotResolveClassException: github-plugin-configuration
              at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:452)
              at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:46)
              at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
              at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
              at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:135)
              at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1464)
              at hudson.util.XStream2.unmarshal(XStream2.java:230)
              at hudson.util.XStream2.unmarshal(XStream2.java:201)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1441)
              at hudson.XmlFile.unmarshal(XmlFile.java:196)
      Caused: java.io.IOException: Unable to read /mnt/data/github-plugin-configuration.xml
              at hudson.XmlFile.unmarshal(XmlFile.java:199)
              at hudson.XmlFile.unmarshal(XmlFile.java:179)
              at hudson.model.Descriptor.load(Descriptor.java:933)
              at org.jenkinsci.plugins.github.config.GitHubPluginConfig.<init>(GitHubPluginConfig.java:86)
              at org.jenkinsci.plugins.github.config.GitHubPluginConfig$$FastClassByGuice$$374e4fd6.GUICE$TRAMPOLINE(<generated>)
              at org.jenkinsci.plugins.github.config.GitHubPluginConfig$$FastClassByGuice$$374e4fd6.apply(<generated>)
              at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
              at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
              at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:33)
              at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:98)
              at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
              at hudson.ExtensionFinder$GuiceFinder$SezpozModule.onProvision(ExtensionFinder.java:610)
              at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:117)
              at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:66)
              at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:93)
              at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
              at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
              at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
              at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:445)
              at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
              at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
              at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:403)
              at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:394)
              at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:359)
              at hudson.ExtensionList.load(ExtensionList.java:384)
              at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320)
              at hudson.ExtensionList.getComponents(ExtensionList.java:184)
              at hudson.DescriptorExtensionList.load(DescriptorExtensionList.java:213)
              at hudson.ExtensionList.ensureLoaded(ExtensionList.java:320)
              at hudson.ExtensionList.iterator(ExtensionList.java:172)
              at hudson.ExtensionList.get(ExtensionList.java:149)
              at jenkins.plugins.shiningpanda.tools.PythonInstallation.list(PythonInstallation.java:128)
              at jenkins.plugins.shiningpanda.tools.PythonInstallation.isEmpty(PythonInstallation.java:119)
              at jenkins.plugins.shiningpanda.ShiningPanda.postInitialize(ShiningPanda.java:51)
              at hudson.PluginManager$2$1$2.run(PluginManager.java:583)
              at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:177)
              at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
              at jenkins.model.Jenkins$5.runTask(Jenkins.java:1164)
              at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:221)
              at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:120)
              at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
              at java.base/java.lang.Thread.run(Thread.java:829)

      We are mounting an external EBS volume on AWS containing our jenkins data to /mnt/data. I've checked file permissions are correct and the jenkins user can most definitely read/write to this location. Because the configuration does not re-load, after each restart I need to go to Dashboard > Manage Jenkins > System and input my Github server configuration (see image).

      I've tried removing the file and re-configuring the plugin. After this /mnt/data/github-plugin-configuration.xml gets regenerated as expected. However when I restart it still fails to load.

      I recall seeing this issue pop up with an older version of this plugin, but I cannot find the link. Any help solving this is appreciated!

          [JENKINS-71786] Github Plugin configuration does not load after service restart

          Mark Waite added a comment -

          This seems like a configuration question or a diagnostic question rather than an issue with Jenkins or the Jenkins plugin. We track bugs and enhancements in the Jenkins issue tracker. We use https://community.jenkins.io and https://www.jenkins.io/chat/ for question and answer.

          Those locations have more readers and are more likely to provide an answer.

          Mark Waite added a comment - This seems like a configuration question or a diagnostic question rather than an issue with Jenkins or the Jenkins plugin. We track bugs and enhancements in the Jenkins issue tracker. We use https://community.jenkins.io and https://www.jenkins.io/chat/ for question and answer. Those locations have more readers and are more likely to provide an answer.

          Paul added a comment -

          Hi Mark, thanks. I was unsure this was the correct place. I will ask on the community channel then.

          Paul added a comment - Hi Mark, thanks. I was unsure this was the correct place. I will ask on the community channel then.

          Paul added a comment -

          In case anyone finds him/herself here - I created this topic on the community forum:

          https://community.jenkins.io/t/github-plugin-configuration-does-not-load-after-service-restart/8956

          Paul added a comment - In case anyone finds him/herself here - I created this topic on the community forum: https://community.jenkins.io/t/github-plugin-configuration-does-not-load-after-service-restart/8956

          James Howe added a comment -

          This is not a user configuration problem. The plugin is failing to find the correct class for the xml that it wrote out.

          See also: https://stackoverflow.com/questions/75864380/github-plugin-error-causing-git-servers-not-loading-after-jenkins-upgrade

          Cloudbees claims this fixes it, but it did not for me: https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-controllers/github-plugin-settings-not-loaded-on-startup

          James Howe added a comment - This is not a user configuration problem. The plugin is failing to find the correct class for the xml that it wrote out. See also: https://stackoverflow.com/questions/75864380/github-plugin-error-causing-git-servers-not-loading-after-jenkins-upgrade Cloudbees claims this fixes it, but it did not for me: https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-controllers/github-plugin-settings-not-loaded-on-startup

          Kevin Chhan added a comment - - edited

          jameshowe Both cases have the same symptom, but the problematic plugin in https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-controllers/github-plugin-settings-not-loaded-on-startup was the support-core plugin.

          In this case, the problem is the shiningpanda plugin:

                  at hudson.ExtensionList.get(ExtensionList.java:149)
                  at jenkins.plugins.shiningpanda.tools.PythonInstallation.list(PythonInstallation.java:128)
                  at jenkins.plugins.shiningpanda.tools.PythonInstallation.isEmpty(PythonInstallation.java:119)
                  at jenkins.plugins.shiningpanda.ShiningPanda.postInitialize(ShiningPanda.java:51)
                  at hudson.PluginManager$2$1$2.run(PluginManager.java:583)

          Adding this plugin to components.
          I have reproduced this issue with a new instance of Jenkins 2.462.1, github:1.40.0, and shiningpanda: 0.24. The github configuration files does not load in initialization but the xml file still exists in the filesystem.

          Untested, but a workaround might be to add a init.groovy.d script that reapplies the configuration.

           

          Kevin Chhan added a comment - - edited jameshowe Both cases have the same symptom, but the problematic plugin in https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/client-and-managed-controllers/github-plugin-settings-not-loaded-on-startup was the support-core plugin. In this case, the problem is the shiningpanda plugin:       at hudson.ExtensionList.get(ExtensionList.java:149)         at jenkins.plugins.shiningpanda.tools.PythonInstallation.list(PythonInstallation.java:128)         at jenkins.plugins.shiningpanda.tools.PythonInstallation.isEmpty(PythonInstallation.java:119)         at jenkins.plugins.shiningpanda.ShiningPanda.postInitialize(ShiningPanda.java:51)         at hudson.PluginManager$2$1$2.run(PluginManager.java:583) Adding this plugin to components. I have reproduced this issue with a new instance of Jenkins 2.462.1, github:1.40.0, and shiningpanda: 0.24. The github configuration files does not load in initialization but the xml file still exists in the filesystem. Untested, but a workaround might be to add a init.groovy.d script that reapplies the configuration.  

            Unassigned Unassigned
            paultoliver Paul
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: