Configuration-as-code-plugin: Installation of Plugins Through CASC Doesn't Trigger Jenkins Restart

Created on 29 Oct 2018  路  8Comments  路  Source: jenkinsci/configuration-as-code-plugin

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)

Most helpful comment

We won't add them back :smile:
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

All 8 comments

D'oh. I think I was misunderstanding the rep's README. I thought

Current implementation do require a restart if you add a plugin.

meant that it would restart Jenkins when adding a plugin, but I think it means a manual restart is required. Could someone confirm if that's the case?

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

@ndeloof Thanks for the info.

Just to make sure I'm on the same page, plugin installation is actually expected to cause a restart in the current implementation, and not just for plugin updates?

I understand that plugin support is not fully realized yet. I just want to make sure I have an understanding of the current behavior.

I'm +1'ing this. I'm running into this very same problem. I'm unable to add configurations such as Docker because docker-plugin has to be loaded first. But attempting to load docker-plugin: latest in the same file as cloud: \n docker: configuration is crashing Jenkins on start.

I can't required: plugs + configure them in the same configuration file.

@timja @casz I read up on the removal and I get why it's happening. Just wanted to mention that if/when you add full support for managing plug-ins back in, that'll be greatly appreciated. Managing them through Ansible is a nightmare of manually managed dependencies.

We won't add them back :smile:
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

Hah, fair enough, and thanks for the link.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reschex picture reschex  路  4Comments

alexgeek picture alexgeek  路  7Comments

aheritier picture aheritier  路  3Comments

badamb9 picture badamb9  路  5Comments

szandala picture szandala  路  4Comments