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.

Installation of Plugins Through CASC Doesn't Trigger Jenkins Restart

See original GitHub issue

Description

I’m currently working on defining a new Jenkins box for my organization, using Ansible and this plugin to try to codify as much as possible. One thing I’ve run into is when Jenkins runs through the initial application/verification of the configuration files, installing a plugin does not seem to trigger a restart. I currently have two config files, with the plugin one named to be read first, alphanumerically. I’ve also tried having the plugin file named to be read last and it doesn’t seem to change anything about whether a restart occurs.

Worth noting, is that the Jenkins UI indicates that a restart is necessary when viewing the Installed Plugins, so that seems to suggest that a restart should happen but is not being triggered.

Questions

  • I noticed there’s behavior in the code for plugin support to detect whether or not a restart should happen. I’m only installing new plugins at the moment, as opposed to updating. Would that suggest that the plugin installation is not throwing the UpdateCenter.DownloadJob.SuccessButRequiresRestart error that’s expected?
  • Is there some way to force a restart through the JCASC plugin?
  • I’m triggering the application/verification of JCASC files by forcing Jenkins to restart after the config files are updated.

Version info

  • Jenkins Version: 2.149
  • Plugin Version: 1.2
  • OS: CentOS Linux release 7.5.1804 (Core)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jetersencommented, Mar 20, 2019

We won’t add them back 😄 The work should be done inside Jenkins Core as stated. This is the issue to pile in on https://issues.jenkins-ci.org/browse/JENKINS-53767

1reaction
ndeloofcommented, Oct 30, 2018

You’re right that we rely on SuccessButRequiresRestart to trigger a restart. I assume the plugin you selected for installation don’t ask for it, but then the message you get from web UI is weird.

Please note plugin installation is experimental and mostly hack-ish, if you have any other way to manage plugin installation (maybe relying on install-plugins script), go for it.

Also see https://issues.jenkins-ci.org/browse/JENKINS-53767 for need for this as a generic and official tool

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
jenkinsci/configuration-as-code-plugin - Gitter
I have tried to install plugins by installing them online first, grabbed the $JENKINS_HOME/plugins folder and when I was offline drag and dropped...
Read more >
Jenkins Plugins are not installed : Command Line
Additionally, you need to restart the jenkins service after installing plugins. It is already running after installation. – Matt Schuchard. Aug ...
Read more >
Getting started with plugin management
This option allows for plugins to be defined in code and automates their installation on restart or retry. With CasC, you add plugins...
Read more >
Customization with Groovy Scripts and CasC - GitHub Pages
Operator caches downloaded plugins by itself, so that on subsequent installations of the same plugin versions (for example, after a Jenkins restart) Operator ......
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