CasC is unable to reapply GlobalJobDslSecurityConfiguration after Jenkins restart
See original GitHub issueI firstly observed that behavior when killing our Jenkins pod in K8s and it didn’t get back up. CasC 0.7-alpha was unable to reapply following part of the configuration. It also happened with earlier versions.
security:
GlobalJobDslSecurityConfiguration:
useScriptSecurity: false
The exception thrown is:
Caused by: org.jenkinsci.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.GlobalConfigurationCategory$Security : GlobalJobDslSecurityConfiguration
I traced it back to following line not resolving to true after restart for the GlobalJobDslSecurityConfiguration: https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/src/main/java/org/jenkinsci/plugins/casc/GlobalConfigurationCategoryConfigurator.java#L61
The culprit is
descriptor.getCategory() == category
resolving to false after restart.
See PR #255 for failing testcase.
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (13 by maintainers)
Top Results From Across the Web
JCasC warning log for GlobalJobDslSecurityConfiguration ...
During Jenkins startup I get: WARNING i.j.p.casc.BaseConfigurator#createAttribute: Can't handle class javaposse.jobdsl.plugin.
Read more >Jenkins Home config.xml reset upon restart
So when jenkins is restarted, the configuration-as-code plugin uses the CASC/jenkins.yaml file to configure jenkins which DOES NOT have the ...
Read more >A wrong configuration of CasC yaml kill Jenkins startup
While testing the CasC plugin I've found that if the yaml is wrong, Jenkins stop restarting, leaving you with an unoperational instance.
Read more >Got IllegalStateException while restart Jenkins
When I restart jenkins using /restart command or after plugin installation I got the following error at Jenkins restart page: Stack tracejava.lang.
Read more >Pipeline fails to resume after master restart/plugin upgrade
During a recent Jenkins plugin upgrade and master restart, it seems that Jenkins failed to resume at least two Pipeline jobs. The pipeline...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
got it:
serialized xml for GlobalJobDslSecurityConfiguration includes an unexpected line:
This is caused by groovy style property used to override getCategory
doing so, XStream do consider a filed to be serialized, not just a method override. As a result, on load, XStream do create a fresh new
jenkins.model.GlobalConfigurationCategory$Security
instance, which is != from the singleton it is supposed to be.@ndeloof @ewelinawilkosz I think this issue can be closed :
job-dsl-1.71
release of January