How I can change the default directory which Jenkins will use to load plugins?

404 views
Skip to first unread message

Vladimir

unread,
Oct 13, 2022, 3:17:50 PM10/13/22
to Jenkins Users
I have a server which periodically I want to update. I've moved JENKINS_HOME directory to a separate disk volume. Configuration for server saved as yaml file CASC, jobs and history also stored inside the volume. And I run Jenkins server as a Docker container.
I expected that if I will provide an updated docker image with the new Jenkins version and updated plugins it will just load jobs and configuration and will work. And it did work for some time.  But recently I stumbled on an error like this.

- Update required: commons-lang3 v3.x Jenkins Api Plugin (commons-lang3-api 3.12.0.0) to be updated to 3.12.0-36.vd97de6465d5b_ or higher
jenkins  |     at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:994)
jenkins  |     at hudson.PluginManager$2$1$1.run(PluginManager.java:542)


The issue is that plugins are also stored in JENKINS_HOME directory and a  new Jenkins version in the docker image was not able to start with old plugins.
I expected that I will be able to tell Jenkins where to look for plugins so only jobs, config, history and other configurations will be loaded from the attached volume but Jenkins itself will use updated plugins from the inside image.
I've tried this property hudson.PluginManager.workDir    https://www.jenkins.io/doc/book/managing/system-properties/#hudson-pluginmanager-workdir but it is not working
Jenkins still trying to look inside JENKINS_HOME/plugins


My question is it possible to point Jenkins to directly with plugins, so it will not pay attention to JENKINS_HOME/plugins ?

Richard Bywater

unread,
Oct 14, 2022, 12:50:54 AM10/14/22
to jenkins...@googlegroups.com
Have you read the Preinstalling plugins section on the Docker image documentation? https://github.com/jenkinsci/docker/blob/master/README.md#preinstalling-plugins

Richard.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6faef0f6-d9f8-47f5-a993-ca639a4ff6ban%40googlegroups.com.

M Foster

unread,
Nov 4, 2022, 7:44:28 PM11/4/22
to Jenkins Users
I'm having this same issue and I am pre-installing the plugins in a custom Docker image, trying to avoid issues with plugins dependencies. This issue is, as mentioned above, is that the "plugins" directory in JENKINS_HOME, if using a persistent Docker volume, has the old .jpi versions of the plugin and Jenkins is now throwing an error. Something seems to have changed between I'd say 2.361.1 and 2.361.3 because this is new.

M Foster

unread,
Nov 4, 2022, 8:00:34 PM11/4/22
to Jenkins Users
I've tested this on a fresh test copy and it seems to be working as expected. Upgrades between versions seem to be correctly copying the newer version of plugins to the plugin directory. I don't know why it didn't seem to work on my other staging instance of Jenkins though, so I don't have confidence it will work on my production servers. Any suggestions on why this particular instance didn't upgrade the plugins directory with the new versions installed from the new Docker image.
Reply all
Reply to author
Forward
0 new messages