Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to run when plugins directory is a docker mounted volume #214

Closed
halkeye opened this issue Oct 31, 2020 · 0 comments
Closed

Fails to run when plugins directory is a docker mounted volume #214

halkeye opened this issue Oct 31, 2020 · 0 comments

Comments

@halkeye
Copy link
Member

halkeye commented Oct 31, 2020

Because in docker when a directory is marked as a volume, it gets mounted into the container, which means it can't actually be deleted.

$ rm -rf /usr/share/jenkins/ref/plugins
rm: cannot remove '/usr/share/jenkins/ref/plugins': Device or resource busy
$ java -jar /usr/lib/jenkins-plugin-manager.jar -w /usr/share/jenkins/jenkins.war --verbose -f /var/jenkins_home/plugins.txt
File containing list of plugins to be downloaded: /var/jenkins_home/plugins.txt
Reading in plugins from /var/jenkins_home/plugins.txt

No directory to download plugins entered. Will use default of /usr/share/jenkins/ref/plugins
Using update center https://updates.jenkins.io/update-center.json from JENKINS_UC environment variable
Using experimental update center https://updates.jenkins.io/experimental/update-center.json from JENKINS_UC_EXPERIMENTAL environment variable
Using incrementals mirror https://repo.jenkins-ci.org/incrementals from JENKINS_INCREMENTALS_REPO_MIRROR environment variable
No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/plugin-versions.json
Will use war file: /usr/share/jenkins/jenkins.war
java.io.UncheckedIOException: Unable to delete: /usr/share/jenkins/ref/plugins
        at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:129)
        at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:113)
        at io.jenkins.tools.pluginmanager.cli.Main.main(Main.java:63)
Caused by: java.io.IOException: Unable to delete directory /usr/share/jenkins/ref/plugins.
        at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1212)
        at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:127)
        ... 2 more
Unable to delete: /usr/share/jenkins/ref/plugins

I think the fix is to delete the contents of the directory, and not the directory itself but having trouble figuring out a clean solution for that. or maybe a flag to make it not delete the directory which would help #108

halkeye added a commit to halkeye/plugin-installation-manager-tool that referenced this issue Oct 31, 2020
halkeye added a commit to halkeye/plugin-installation-manager-tool that referenced this issue Nov 1, 2020
@timja timja closed this as completed in e7d303c Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant