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.

Config as code runs too early in the lifecycle

See original GitHub issue

Your 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:closed
  • Created 4 years ago
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
timjacommented, Feb 18, 2020

@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

1reaction
jtnordcommented, Oct 16, 2019

looked at the Jenkins code init groovy hook and casc are in different init stages, they should not interfere with each other?

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)

Read more comments on GitHub >

github_iconTop 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 >

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