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.

enabling managehooks settings through DSL CasC does not work

See original GitHub issue

Your checklist for this issue

🚨 Please review the guidelines for contributing to this repository.

  • [ x ] Jenkins version – Jenkins 2.235.1

  • [ x ] Plugin version – Bitbucket Branch source 2.8.0

  • [ x ] OS – Linux


We have jenkins.yaml where we have all the jenkins global configurations. When we enable the manageHooks settings by making it “true” the same is not getting applied in JenkinsGUI. We are getting the below error, when we restart the jenkins instance.

java.lang.IllegalArgumentException: No enum constant com.cloudbees.jenkins.plugins.bitbucket.server.BitbucketServerWebhookImplementation.Plugin
	at java.lang.Enum.valueOf(
	at org.kohsuke.stapler.Stapler$6.convert(
	at io.jenkins.plugins.casc.impl.configurators.PrimitiveConfigurator.configure(
	at io.jenkins.plugins.casc.BaseConfigurator.configure(
	at io.jenkins.plugins.casc.BaseConfigurator.configure(
	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(
	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(
	at io.vavr.Tuple2.apply(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(
	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(
	at io.jenkins.plugins.casc.BaseConfigurator.configure(
	at io.jenkins.plugins.casc.BaseConfigurator.check(
	at io.jenkins.plugins.casc.BaseConfigurator.configure(
	at io.jenkins.plugins.casc.BaseConfigurator.check(
	at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$checkWith$8(
	at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(
	at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(
	at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(
	at io.jenkins.plugins.casc.ConfigurationAsCode.configure(
	at io.jenkins.plugins.casc.ConfigurationAsCode.init(
Caused: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at hudson.init.TaskMethodFinder.invoke(
Caused: java.lang.Error
	at hudson.init.TaskMethodFinder.invoke(
	at hudson.init.TaskMethodFinder$
	at org.jvnet.hudson.reactor.Reactor.runTask(
	at jenkins.model.Jenkins$5.runTask(
	at org.jvnet.hudson.reactor.Reactor$
	at org.jvnet.hudson.reactor.Reactor$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
Caused: org.jvnet.hudson.reactor.ReactorException
	at org.jvnet.hudson.reactor.Reactor.execute(
	at jenkins.model.Jenkins.executeReactor(
	at jenkins.model.Jenkins.<init>(
	at hudson.model.Hudson.<init>(
	at hudson.model.Hudson.<init>(
	at hudson.WebAppMain$
Caused: hudson.util.HudsonFailedToLoad
	at hudson.WebAppMain$

We are using Atlassian Bitbucket v5.8.2

Let me know if you need more details.

Kindly help us fix the issue. Thanks in advance!

Regards, Akilesh D S

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

jetersencommented, Jul 29, 2020

Seeing some deserialize errors though it definitely seems like JCasC is able to consume the enum. Though I suggest adding a native and plugin endpoint to the should_support_configuration_as_code in bitbucket branch source

3.665 [id=25]	WARNING	o.j.r.u.AnonymousClassWarnings#warn: Attempt to (de-)serialize anonymous class com.cloudbees.jenkins.plugins.bitbucket.server.BitbucketServerWebhookImplementation$1 in file:/C:/git/code/bitbucket.branch.source.plugin/target/classes/; see:
3.665 [id=25]	WARNING	o.j.r.u.AnonymousClassWarnings#warn: Attempt to (de-)serialize anonymous class com.cloudbees.jenkins.plugins.bitbucket.server.BitbucketServerWebhookImplementation$2 in file:/C:/git/code/bitbucket.branch.source.plugin/target/classes/; see:
bitwisemancommented, Jul 30, 2020

@dsakilesh Yeah, capitalization matters. I don’t understand your secondary question, but it would probably be better asked on

This issue can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jenkinsci/configuration-as-code-plugin - Gitter
Hi @casz , I am currently switching from Bitbucket to Gitlab in my fully 'casc-ed' Jenkins and want to use the gitlab-branch-source-plugin because...
Read more >
Configuration as Code - Jenkins
The Jenkins Configuration as Code (JCasC) feature defines Jenkins configuration parameters in a human-readable YAML file that can be stored as source code....
Read more >
Jenkins-as-Code Part II | Configuration - Karl Fischer
In this part we will focus on configuring Jenkins through code. ... It is called the configuration-as-code plugin (CasC).
Read more >
How to escape ${} in Jenkins configuration as code (casc ...
It did not work. When the DSL plugin parses the script it evaluates ${CAPP_ENTRY[0]} to empty and leaves only (\) which gets considered...
Read more >
Unable to configure Fork Change Request Trait using Job DSL
But unfortunately job dsl api viewer doesn't detect Fork Merge Request Trait. ... Our Job DSL configuration is incorrect (note unable to configure...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found