Config as code runs too early in the lifecycle
See original GitHub issueYour checklist for this issue
🚨 Please review the guidelines for contributing to this repository.
-
Jenkins version (any / 2.176.2)
-
Plugin version (any / 1.29)
-
OS (any)
Description
Config as code applies the configuration after InitMilestone.EXTENSIONS_AUGMENTED
. However the configuration of Jenkins
is loaded after this and before JOBS_LOADED
and as such as Config-As-Code will be manipulating state it can and will end up save()ing
to disk whilst Jenkins is loading up. This will mean that potential changes that Config-As-Code has made may be lost and you will start up with a Jenkins that is not correctly configured.
see
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
Customize Amazon SageMaker Studio using Lifecycle ...
Lifecycle configurations are shell scripts triggered by Studio lifecycle events, such as starting a new Studio notebook. You can use these shell ...
Read more >Running code after Spring Boot starts - Stack Overflow
I found, that Lifecycle is the prefered option to perform asynchronous tasks on start/stop stages of the application, and I'm trying to spot...
Read more >The lifecycle Meta-Argument - Terraform - HashiCorp Developer
As a result, only literal values can be used because the processing happens too early for arbitrary expression evaluation.
Read more >Test lifecycle - Grafana k6
Setup, Set up data for processing, share data among VUs, Call API to start test environment, Once. 3. VU code, Run the test...
Read more >Addressing Security Throughout the Infrastructure DevOps ...
Learn how to address cloud security at each step of the ... lifecycle, from infrastructure as code in your IDE to running cloud...
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
@jtnord there’s a pull request for it but we’re having a weird test failure on CI for java 11 which we can’t reproduce locally 😢
https://github.com/jenkinsci/configuration-as-code-plugin/pull/1262
correct.
depending on what configuration you are loosing you may just be hitting this race condition that, or there could be other plugins trying to save some jenkins config during startup. given (mostly) jcasc would be trying to set the configuration that is already on disk on restart I would be surprised you are loosing things (I would expect more a situation where new updates do not get correctly applied - but given the race condition all manner of things could go haywire).
I would suggest you raise a specific issue for your scenario with all of the CasC files and details of the plugins/versions and jenkins version you are using. It may well be that this is the root cause, but it could also be something different (and having a set of files where it does reproduce is extremely helpful. Given timing may be involved if you are running in a public cloud provider providing details of the instance type and disk etc may also help in tracking down the issue (I spent many weeks tracking down a similar issue elsewhere that one person could reliably hit but no one else could reproduce)