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

Removing plugin results in remnant JCasc config crashing Jenkins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • Jenkins 2.263.4
      configuration-as-code:1.54
      ( weblogic-deployer-plugin:4.1 )

      (Should really be a blocker, but there is a workaround).

      Installed Deploy WebLogic plugin, added JCasC configuration for plugin. Determined plugin does not meed our needs, removed plugin, failed to remove JCasC config for plugin. Upon restart, got the stacktrace below.

      Jenkins process is still running, can't get off the error page. Kill the process, remove the plugin'' segment of JCasC yaml, system starts up fine, (even though the xml config - org.jenkinsci.plugins.deploy.weblogic.WeblogicDeploymentPlugin.xml, is left behind.)

      If the plugin is installed and no JCasC segment, then the system would start w/o configuration for the plugin . But JCasC configuration for a missing plugin renders Jenkins useless, even if there's a valid plugin configuration.

      Jenkins should throw an error, perhaps an Administrative Alert indicating missing (intended) functionality if a plugin for a given JCasC segment is not available. It should NOT render the system useless just as the leaving the redundant plugin configuration behind.

      I don't believe there's anything specific to the deploy-weblogic plugin that is the problem; removing any plugin while leaving the plugin specific JCasC behind will cause same failure. Validated by removing the sonar plugin and got similar:
      io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.GlobalConfigurationCategory$Unclassified : sonarGlobalConfiguration.

      Note: We have multiple yml files in ./init.CasC, generally one file per plugin or capability.

      tools.weblogic.yaml

      unclassified:
        weblogicDeploymentPlugin:
          extraClasspath: "~/.m2/repository/weblogic/1036/wlfullclient/10.3.6/wlfullclient-10.3.6.jar"
          javaOpts: "-Xms256M -Xmx256M"
          jdkSelected: "jdk11-hotspot"
          pluginDisabled: false
      

      Stacktrace:

      io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.GlobalConfigurationCategory$Unclassified : weblogicDeploymentPlugin.
      Available attributes : administrativeMonitorsConfiguration, artifactManager, buildDiscarders, buildFailureAnalyzer, buildTimestampWrapper, buildUser, buildUserVars, casCGlobalConfig, defaultFolderConfiguration, defaultView, dynatraceGlobalConfiguration, email-ext, envInjectNodeProperty, envVarsFilter, fingerprints, gitSCM, globalConfigFiles, globalDefaultFlowDurabilityLevel, globalLibraries, groovy, hashicorpVault, httpRequestGlobalConfig, junitTestResultStorage, location, lockableResourcesManager, mailer, maskPasswordsBuildWrapper, masterBuild, mavenModuleSet, myView, nodeProperties, pipeline-model-docker, pipelineConfigHistoryGlobalConfiguration, plugin, pollSCM, projectNamingStrategy, quietPeriod, resourceRoot, scmRetryCount, setupConfig, shell, singleConditionalBuilder, sonarGlobalConfiguration, tFSLabeler, teamPluginGlobalConfig, timestamper, usageStatistics, viewsTabBar, warningsParsers, warningsPlugin
      	at io.jenkins.plugins.casc.BaseConfigurator.handleUnknown(BaseConfigurator.java:375)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:364)
      	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:286)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:776)
      	at io.jenkins.plugins.casc.ConfigurationAsCode$$Lambda$149/0x0000000000000000.apply(Unknown Source)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:712)
      Caused: io.jenkins.plugins.casc.ConfiguratorException: unclassified: error configuring 'unclassified' with class io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator configurator
      	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:718)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:776)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:761)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:637)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:306)
      	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:298)
      Caused: java.lang.reflect.InvocationTargetException
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
      Caused: java.lang.Error
      	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
      	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
      	at jenkins.model.Jenkins$5.runTask(Jenkins.java:1131)
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:823)
      Caused: org.jvnet.hudson.reactor.ReactorException
      	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
      	at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
      	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1164)
      	at jenkins.model.Jenkins.<init>(Jenkins.java:964)
      	at hudson.model.Hudson.<init>(Hudson.java:85)
      	at hudson.model.Hudson.<init>(Hudson.java:81)
      	at hudson.WebAppMain$3.run(WebAppMain.java:295)
      Caused: hudson.util.HudsonFailedToLoad
      	at hudson.WebAppMain$3.run(WebAppMain.java:312)
      

      WeblogicDeploymentPlugin.xml

      <?xml version='1.1' encoding='UTF-8'?>
      <org.jenkinsci.plugins.deploy.weblogic.WeblogicDeploymentPlugin_-WeblogicDeploymentPluginDescriptor plugin="weblogic-deployer-plugin@4.1">
        <pluginDisabled>false</pluginDisabled>
        <jdkSelected>jdk11-hotspot</jdkSelected>
        <extraClasspath>~/.m2/repository/weblogic/1036/wlfullclient/10.3.6/wlfullclient-10.3.6.jar</extraClasspath>
        <javaOpts>-Xms256M -Xmx256M</javaOpts>
      </org.jenkinsci.plugins.deploy.weblogic.WeblogicDeploymentPlugin_-WeblogicDeploymentPluginDescriptor>
      

            Unassigned Unassigned
            ianw Ian Williams
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: