question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't let unknown keywords stop Jenkins startup

See original GitHub issue

Your checklist for this issue

  • Jenkins version - 2,83
  • Plugin version - 1.47
  • OS - Ubuntu 20.04, x86_64, openjdk-11-jre-headless:amd64

Description

After I removed a plugin (Stash Pull Request Builder) and restarted Jenkins, the top level Jenkins URL showed a page with a stack trace:

io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.GlobalConfigurationCategory$Unclassified : stashBuildTrigger.
Available attributes : administrativeMonitorsConfiguration, artifactManager, bitbucketEndpointConfiguration, buildDiscarders, casCGlobalConfig, defaultFolderConfiguration, defaultView, email-ext, envVarsFilter, fingerprints, gitHubConfiguration, gitHubPluginConfig, gitSCM, globalConfigFiles, globalDefaultFlowDurabilityLevel, globalLibraries, jiraGlobalConfiguration, junitTestResultStorage, location, lockableResourcesManager, mailer, masterBuild, myView, nodeProperties, pipeline-model-docker, plugin, pollSCM, projectNamingStrategy, quietPeriod, resourceRoot, scmRetryCount, shell, timestamper, usageStatistics, viewsTabBar
	at io.jenkins.plugins.casc.BaseConfigurator.handleUnknown(BaseConfigurator.java:376)
	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:365)
	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(ConfigurationAsCode.java:753)
	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:689)
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:695)
	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:753)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:738)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:614)
	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:298)
	at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:290)
Caused: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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:1130)
	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: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:834)
Caused: org.jvnet.hudson.reactor.ReactorException
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:1163)
	at jenkins.model.Jenkins.<init>(Jenkins.java:961)
	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)

I could upload the config without “stashBuildTrigger”, but I had to log in to the Jenkins system to restart it. The URL with “/safeRestart” would just show the same stack trace.

I believe it would be much better if the Configuration ad Code Plugin would just record the issue and continue. There are other ways to alert the user of obsolete parts of the configuration. It’s possible to log an error and show it in the administrative monitor.

The issue is not new, I hit it a few times in the past.

Removing plugins should not be a minefield. Jenkins itself is much more gracious when some code is missing to handle the a configuration file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jetersencommented, Mar 12, 2021

I see no reason to change the default behavior. User is free to change them at anytime. You ought to have a test instance or a dev setup where you can apply changes before breaking the production setup. It is good practice to know the necessary steps ahead of time.

The way we use JCASC may be different but again JCASC is an opinionated way of how to run your Jenkins instance.

WDYT @oleg-nenashev @timja

2reactions
jetersencommented, Mar 12, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipeline Steps Reference - Jenkins
Pipeline Steps Reference. The following plugins offer Pipeline-compatible steps. Each plugin link offers more information about the parameters for each step ...
Read more >
jenkins - Failing a build in Jenkinsfile - Stack Overflow
When failFast true it terminates the parallel tasks. Started by user admin Running in Durability level: MAX_SURVIVABILITY [Pipeline] Start of ...
Read more >
How to Get Started With Jenkins Declarative Pipeline
In this blog post, we will cover all the directives available to develop your Jenkins declarative pipeline script.
Read more >
How to Start, Stop or Restart your Instance?
In that mode Jenkins don't start any build. cancelQuietDown : Cancel the effect of the "quiet-down" command. safeRestart : Puts Jenkins into the...
Read more >
Upgrading your build from Gradle 6.x to the latest
Publishing Spring Boot applications. Starting from Gradle 6.2, Gradle performs a sanity check before uploading, to make sure you don't upload stale files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found